Store list in scope
Function: Store list in scope
This action allows you to take a collection of items (a list) and save it into your application's memory, making it available for use in other parts of your application. Think of it like putting a labeled box of items into a storage room – you can then retrieve that box by its label whenever you need it.
Input,
- List (ARRAY of VARIABLEs): This is the collection of items you want to store. It can be a list of text, numbers, dates, or any other type of data your application handles. If you don't provide a list, an empty list will be stored.
Output,
- Result (ARRAY of VARIABLEs): This is the name you give to the new variable where your list will be stored. After this action runs, you can use this name to access the list throughout your application. This name is required.
Execution Flow,
Real-Life Examples,
-
Example: Storing a list of product categories
- Inputs:
- List:
["Electronics", "Clothing", "Home Goods", "Books"] - Result:
ProductCategories
- List:
- Result: A new variable named
ProductCategoriesis created in your application's memory, containing the list of product categories. You can now useProductCategoriesin dropdowns or filters on your pages.
- Inputs:
-
Example: Storing a list of user IDs from a database query
- Inputs:
- List:
[101, 105, 112, 120](This list might come from a "Get Users" action) - Result:
ActiveUserIDs
- List:
- Result: A variable named
ActiveUserIDsis now available, holding the list of user IDs. You could then use this list to send notifications to these specific users.
- Inputs:
-
Example: Initializing an empty shopping cart
- Inputs:
- List: (Left empty, meaning an empty list)
- Result:
ShoppingCartItems
- Result: An empty list is stored under the variable name
ShoppingCartItems. This variable can then be used to add items as a user browses your online store.
- Inputs: