Step 2: Skip records based on Customer_ID

To skip records based on the values for Customer_ID provided by the user as StartupParameters, actions need to be defined with the shared variable StartupParameters in the “On Reading record” function.

  • To define the Actions, go to the Code tab>On Reading record function and expand it. To add an “Action box”, click the [+ Action box] button.

  • To convert the value received in the Join_Date to integer, add and define an Action in the Code tab.

  • Define the Action as follows. (This value will be used to format the Join_Date later in the exercise):

    1. Select Action as “Update Variable”.

    2. Select Target Value as “defJoinDay”.

    3. Select Value as “reader.Join_Date.toInteger()”.

  • To traverse the list of StartupParameters provided by the user, add and define another action as follows:

    1. Select Action as “Traverse List”.

    2. Select List as “StartupParameters”.

    3. The Variable “item” is created.

  • To verify if any of the entered values in StartupParameters (read as item) match with the Customer_ID, add and define a “Condition action” in the “Traverse List”:

    1. Select Action as “Condition action”.

    2. Enter the Label as “if Customer_ID equals item”.

  • To check if the values read in the Traverse List item match the value of Customer_ID, add a Criteria bar in the “Criteria” tab as follows:

    1. Select Target Value as “reader.Customer_ID”.

    2. Select Operator as “Is Equal”.

    3. Select Source as “item”.

  • To define actions if the criteria is returned as True, in the Code tab>On True section, add and define the following actions:

    1. Action: “Update Variable”, Target Value: “skipRecord”, Value: “true” (record should be skipped)

    2. Action: “Update Variable”, Target Value: “skippedReason”, Value: “Customer is not eligible for this program.” (add reason for skipping the record)

    3. Action: “Break List traverse”(break the loop once all Customer_IDs are traversed and verified)

Last updated