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 (example: Data returned from a web service call) 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:

  1. Open the One-Step Editor.
  2. Add a Step Through Collection Action to the Designer Board.
  3. 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.
  4. Define child Actions for the Step Through Collection Action:
    1. Double-click the Step Through Collection Graphic.
    2. Add child Actions to the Designer Board.
    3. Define properties for each Action.
    4. Click Save to save changes and return to the main Designer Board.
  5. Define Annotation properties.
  6. Click Save to return to the Designer Board for the main One-Step Action.

(Optional) Define conditions that limit when an Action is executed

  1. Right-click an Action on the Designer Board, and then click Action Condition in the context menu. You can also click the Expression buttonon the One-Step Editor toolbar to add conditions to a selected Action. To edit the Action condition, double-click the Expression button, right-click the Action on the Designer Board and select Action Condition, or click the Expression button on the toolbar.
  2. Select Only Run Action [name of Action] if Condition is True check box to define an Expression that controls when the Action is executed.
  3. Define an Expression for the condition:
    Option Description
    Stored Expression Click the Ellipses button 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 Click the Custom Expression button to open the Custom Expression Builder, and then create a custom Expression specifically for this scenario.
  4. Click OK.

© Copyright 2018 Cherwell Software, LLC. All rights reserved.