Concatenate Collection to Text
🧾 Definition
The Concatenate Collection to Text action in Zenphi allows you to transform a collection of values into a single string by joining each item with a specified separator. You can optionally add prefixes or suffixes to each item, remove empty values, and eliminate duplicates — giving you full control over how your output string is structured.
This action is especially helpful when you need to format a list for email, Slack messages, file generation, or any custom string output.
Key capabilities:
- Merge list or collection items into one readable string.
- Control formatting with prefixes, suffixes, and custom separators.
- Clean up data by excluding empties or duplicates.
Example Use Cases
1. Format a List for Email Output
Use this action to turn a dynamic list of values (like approver names or selected items) into a neatly formatted string that can be included in an email body.
2. Generate Delimited Strings for CSV/Reports
Quickly convert a collection of data into a comma-separated or pipe-separated string for use in CSV exports, logs, or integrations with systems expecting text input.
3. Display Assigned Usernames in Forms or Slack
If your flow collects multiple usernames, use this action to format them as a readable string to display in a Zenphi form, Slack message, or document.
4. Clean and Combine User Input
When dealing with inputs that might contain duplicates or empty entries (like optional form fields), use this action to clean the data and return a refined string.
5. Transform API or Variable Data into a Label
When pulling collections from API calls or variables, format them as one string label for easier presentation in a dashboard, task, or external tool.
🔧 Inputs
1. Collection
Description: This is the list or group of values you want to join into a single text string. The collection can come from previous actions, variables, form submissions, or other dynamic sources in your flow.
Example: You have a list of department names collected from a form:["Finance", "HR", "Marketing"]
2. Separator
Description: The character or string that will be placed between each item in the final text. Common separators include commas ,
, pipes |
, semicolons ;
, or even line breaks.
Example: Using the same department list with separator ,
will result in:Finance, HR, Marketing
3. Item Prefix (Optional)
Description: A string that will be added before each item in the collection. It helps format each item in a consistent way.
Example: If prefix is -
, the output becomes:- Finance, - HR, - Marketing
4. Item Suffix (Optional)
Description: A string that will be added after each item in the collection.
Example: If suffix is Dept
, the output becomes:Finance Dept, HR Dept, Marketing Dept
5. Exclude Empty Values (Yes/No)
Description: Choose whether to remove items in the collection that are blank or contain no data. This ensures cleaner output when dealing with incomplete user inputs.
Example: Given ["Finance", "", "HR"]
, enabling this option will result in:Finance, HR
6. Remove Duplicate Values (Yes/No)
Description: When enabled, only the first instance of each value is included. Useful when you want a clean, non-repetitive list.
Example: From ["Finance", "HR", "Finance"]
, enabling this will return:Finance, HR
📤 Outputs
1. Concatenated Values
Description:This output contains the final result of the action — a single text string where all the items from the input collection are combined into one continuous string. Each item is separated by the specified separator, and any optional prefixes or suffixes are applied as configured. This output is useful for further processing, displaying in notifications, or storing as a formatted string.
Example:If the input collection is ["Finance", "HR", "Marketing"]
with a separator ,
, item prefix -
, and item suffix Dept
, the output would be:
- Finance Dept, - HR Dept, - Marketing Dept
This string can now be used elsewhere in your workflow — for example, in an email body or a report.
📘 Example Situation
Imagine you have a workflow where you collect a list of email addresses from a form submission or a database query. You want to send a notification email that includes all these email addresses as a single, comma-separated string.
Using the Concatenate Collection to Text action, you can take that list of email addresses, specify a comma ,
as the separator, and generate one neat string like:
[email protected], [email protected], [email protected]
You can then use this concatenated string directly in the email’s "To" or "Cc" field, making your workflow cleaner and avoiding the need to handle the collection item-by-item manually.
Updated about 17 hours ago