Transform a list to seperated string
Function: Transform a list to seperated string
This action allows you to take a collection of individual items (a list) and combine them into a single piece of text. You can specify a character or phrase to place between each item as they are joined together. This is useful for creating formatted strings from data, like generating a comma-separated list of tags or constructing a file path.
Input,
- List: The collection of values or items you want to combine into a single text string.
- Type: List of values
- Separator: The character(s) or text you want to insert between each item from your list when they are joined. For instance, if your list contains
['Apple', 'Banana', 'Cherry']and you use,as the separator, the result will beApple, Banana, Cherry.- Type: Text
Output,
- Result: The new, single text string created by combining all items from your list using the specified separator. This combined text will be stored in a variable that you name.
- Type: Text
Execution Flow,
Real-Life Examples,
Here are some practical ways you can use the "Transform a list to seperated string" action:
-
Combining Product Tags for Display:
- Scenario: You have a list of tags associated with a product (e.g., "New Arrival", "Bestseller", "Organic") and you want to display them as a single, readable string on your product page.
- Inputs:
- List:
['New Arrival', 'Bestseller', 'Organic'] - Separator:
,(a comma followed by a space)
- List:
- Result: The action creates a text variable containing:
New Arrival, Bestseller, Organic
-
Generating a File Path from Folder Names:
- Scenario: You need to construct a full file path from a list of folder names (e.g.,
['Documents', 'Invoices', '2024']) to save a document in the correct location. - Inputs:
- List:
['Documents', 'Invoices', '2024'] - Separator:
/(a forward slash)
- List:
- Result: The action creates a text variable containing:
Documents/Invoices/2024
- Scenario: You need to construct a full file path from a list of folder names (e.g.,
-
Creating a Dynamic Email Subject Line:
- Scenario: You're sending an automated email and want to include key details from a list of order statuses or customer information in the subject line.
- Inputs:
- List:
['Order #12345', 'Shipped', 'Customer: John Doe'] - Separator:
-(a space, a hyphen, and another space)
- List:
- Result: The action creates a text variable containing:
Order #12345 - Shipped - Customer: John Doe