Define a Step Through Collection Action
Use the Step Through Collection Action to step through each item or object in a collection or array of XML or JSON data and store it as a variable for use in CSM.
This allows users to extract pieces of information that can be used within CSM (example: Create new records and set fields using JSON or XML variables).
To define a Step Through Collection Action for a One-Step™ Action:
- Open the One-Step Editor.
- Add a Step Through Collection Action to the Designer Board.
- Define General properties for the Step Through Collection Action:
Option Description Name Provide a display name for the Action (this is how the Action is identified within the One-Step Action). Collection to step through Provide the collection for the Action to step through (a variable that is a JSON Array or XML Collection, such as the result of a web service call). Order Select the Step through in reverse order check box to have the action step through the items in the XML or JSON collection in reverse order. Item Variable Name Provide a name for the variable that stores the value of each item in the specified collection. This variable can be used in child actions (example: Display values in a popup, populate fields in a Business Object, etc.). Use Modifiers on the variable to extract the appropriate pieces of information from the XML or JSON data. Stop on Error Select if the Action should be terminated if an error occurs.
- Define child Actions for the Step Through Collection Action:
- Double-click the Step through collection graphic.
- Add child Actions to the Designer Board.
- Define properties for each Action.
- Select Save to save changes and return to the main Designer Board.
- Define Annotation properties.
- Select Save to return to the Designer Board for the main One-Step Action.
(Optional) Define conditions that limit when an Action is executed
- Right-click an Action on the Designer Board, and then select Action Condition in the context menu. You can also select Expression on the One-Step Editor toolbar to add conditions to a selected Action.
- Select the Only run action [name of action] if condition is true check box to define an expression that controls when the Action is executed.
- Define an expression for the condition:
Option Description Most recently used Expression Select the drop-down list to choose a most recently used expression. Stored Expression Select the ellipsis to open the Expression Manager, and then select an existing stored expression or create a new stored expression. Stored expressions can be reused in numerous places in CSM. Custom Expression Select Custom Expression to open the Custom Expression Builder, and then create a custom expression specifically for this scenario.