Ask AI
Skip to main content

Transform seperated string to list

Function: Transform Separated String to List

This action helps you take a single piece of text that contains multiple items separated by a specific character (like a comma or semicolon) and turn it into a list of individual items. This is useful when you receive data in a combined format and need to work with each item separately.

Input,

  • Separated String: The main piece of text you want to break apart. This text should contain multiple values joined together by a specific character.
  • Separator: The character or symbol that divides the items within your "Separated String." For example, if your string is "apple,banana,orange", the separator would be a comma (,).

Output,

  • Result: This is the name of a new variable that will be created in your application's "Variable scope." This variable will hold the new list of individual text items. By default, this variable will be named SEPERATED_LIST, but you can change it to something more descriptive if you wish.

Execution Flow,

Real-Life Examples,

  1. Extracting Product Tags from a Description Field

    • Scenario: You have a product description field that stores tags as a single string like "Electronics,Gadgets,Smart Devices". You want to use these tags individually for filtering.
    • Inputs:
      • Separated String: "Electronics,Gadgets,Smart Devices"
      • Separator: "," (comma)
    • Result: A new variable named SEPERATED_LIST (or a name you choose, e.g., ProductTags) will be created, containing the list: ["Electronics", "Gadgets", "Smart Devices"].
  2. Processing User Roles from a Configuration Setting

    • Scenario: Your application's settings store user roles for a specific group as "Admin;Editor;Viewer". You need to check each role individually.
    • Inputs:
      • Separated String: "Admin;Editor;Viewer"
      • Separator: ";" (semicolon)
    • Result: A new variable named SEPERATED_LIST (or a name you choose, e.g., UserRoles) will be created, containing the list: ["Admin", "Editor", "Viewer"].
  3. Splitting a List of Ingredients from a Recipe Text

    • Scenario: A recipe's ingredient list is stored as "Flour|Sugar|Eggs|Milk". You want to display each ingredient on a separate line.
    • Inputs:
      • Separated String: "Flour|Sugar|Eggs|Milk"
      • Separator: "|" (pipe symbol)
    • Result: A new variable named SEPERATED_LIST (or a name you choose, e.g., RecipeIngredients) will be created, containing the list: ["Flour", "Sugar", "Eggs", "Milk"].