Use Case: Populating Custom Fields

In this use case, you add two Text custom fields to the primary table: Cities and Name. Then you dynamically create an extended field list in a Service step that populates these fields.
Note: In this use case, you use working data as input to the ForEachNode loop, and the ForEachNode loop creates an extended field list as an input to the UpdateItem step. The same logic can be used when an event contains array records (that is, you have arrays included in the Extension data in an event definition). Instead of using the working data as the input to the ForEachNode step, you can use the EventNotice.
The orchestration workflow loops through each node and processes it as follows:
  1. Sets the database name of the first field in the extended field list.
  2. Sets the value of the first field in the extended field list.
  3. Sets the database name of the second field in the extended field list.
  4. Sets the value of the second field in the extended field list.
  5. Updates the fields in the SBM item with information in the extended field list.

To dynamically create an extended field list that populates custom fields:

  1. Add steps to the orchestration workflow as shown below.

    image

  2. Define the working data for the orchestration workflow:
    1. Create an array with two array elements. Set a default value for each array element.
    2. Add a variable to store the number of loops through the ForEachNode step, using the type "Integer." Set the default value of the variable to 0.

    image

  3. In the ForEachNode step, enter an expression that describes the source of the data to be processed. In this example, the Node array is the source of the data.

    image

  4. Configure the CopyNumber step to store the number of times the orchestration workflow loops through the ForEachNode step.

    image

    Note: This step must be included. You must copy the number of loops into the working data; you cannot use the ForEachNode step by itself.
  5. Configure the Node1 branch to set the index value for the "cities" node to "1."

    image

  6. Configure the SetCitiesField step to set the database name of the first extended field to CITIES.

    image

  7. Configure the SetNameField step to set the database name of the second extended field to NAME.

    image

  8. Configure the SetFieldValue step to set the value of the applicable extended field.

    image

    Note: In this use case, you use the first array element to create the CITIES extended field and the second array element to create the NAME extended field. The index used in the Target expression for the SetCitiesField and SetNameField steps shows the first array element using [1], and the second array element using [2]. The order in which these fields are defined in the application table does not matter; you can use any order in the orchestration workflow. However, after the order is set, the values for those fields must be in the same order. For example, after [1] is assigned "CITIES," its value will be extendedField[1].value[1].displayValue.
  9. Configure the UpdateItem step to populate the custom fields in SBM items.

    image

    image