append¶
The append filter is designed to concatenate a specified string to the end of the input string.
Functionality
- Strings: Takes a string as input.
- Appendage: Requires a string argument to append to the end.
- Output: Returns a new string with the appended string added to the end.
Syntax
Arguments
- string_to_append: The string that you want to add to the end of the
input_string.
Code Samples
Example 1: Appending a Word
Output:
Example 2: Appending a SentenceOutput:
Example 3: Appending a Number (Automatically Converted to String)Output:
Outliers and Special Cases¶
- Empty Strings: Appending to an empty string simply returns the appended string.
- Non-String Input: If the input is not a string, the
appendfilter might attempt to convert it to a string or return an error, depending on how Experience Builder handles type conversions. - Multiple Appends: You can chain multiple
appendfilters to concatenate several strings together.
Key Points¶
- The
appendfilter is straightforward and useful for building strings dynamically within templates. - It automatically handles concatenating strings and other data types (which are converted to strings).
- Consider using the
prependfilter if you need to add a string to the beginning instead of the end.