--- title: "SDK: Text Merge Extensions" slug: "text-merge-extensions" description: "Use built-in Text Merge fields to modify strings or insert data, or create Text Merge Extensions with custom merge logic." updated: 2026-07-13T17:41:41Z published: 2026-07-13T17:41:41Z canonical: "documentation.decisions.com/text-merge-extensions" --- > ## Documentation Index > Fetch the complete documentation index at: https://documentation.decisions.com/llms.txt > Use this file to discover all available pages before exploring further. # SDK: Text Merge Extensions ## Overview Decisions includes a number of built-in text merge fields like "Capitalize," "Lower," and "Insert Current Date." These merge fields can be used to dynamically manipulate strings or insert data from other sources into a Text Merge. Text merge extensions allow a user to write custom text merge logic to accomplish any type of merge desired. ## Example This example will demonstrate how to create a text merge that returns the length of a string. 1. Download the **Decisions SDK** from **Manage** **NuGet Packages** and add the following using statements**:** ```csharp using DecisionsFramework.Design.Text; using DecisionsFramework.ServiceLayer.Services.ContextData; using DecisionsFramework.Utilities.Data; ``` 2. Have the class inherit from and implement AbstractStringFieldExtension. When implementing this class, it includes two override methods: string **GetMergeText** and string Name. The string returned by GetMergeText will be the string displayed at the run time of your Text Merge. The string returned by **Name** will be the name of the merge displayed at design time. Below is an example implementation of string Name which will return the name of **Get String Length.** ```csharp public override string Name => "Get String Length"; ``` This name of Get String Length will show in the Designer as shown below: ![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/image-1782240089035.png) Below is an example implementation of the string GetMergeText method which will return the length of the string. ```csharp public override string GetMergeText(DataPair[] data) { string text = null; object value; if (DataUtilities.TryGetValue(data, TextField, out value)) { text = Convert.ToString(value); return text.Length.ToString(); } else { return null; } } ``` Using this new Get String Length merge, the string's length will be returned as shown below: ![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/image-1782240175127.png)