# 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.

![](https://2351945889-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVoxOh7gdjWdmqooFdYBY%2Fuploads%2Fh9OMmX4lX13cLaxENXAz%2FONReadingRecord_AddActionBox.png?alt=media\&token=5173092c-a3b5-493d-8f24-9309a779fd8f)

* To convert the value received in the Join\_Date to integer, add and define an Action in the Code tab.

![](https://2351945889-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVoxOh7gdjWdmqooFdYBY%2Fuploads%2FSkzDMCRUiEQFNLCuQK2q%2FONReadingRecord_AddAction.png?alt=media\&token=7aa39901-0c52-4dc6-9668-ebebe4368934)

* 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”.&#x20;
  2. Select Target Value as “defJoinDay”.&#x20;
  3. Select Value as “reader.Join\_Date.toInteger()”.

![](https://2351945889-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVoxOh7gdjWdmqooFdYBY%2Fuploads%2Fsxwqv4BHUSbTuySlGnbS%2FONReadingRecord_UV1.png?alt=media\&token=6d97d0e1-6643-42a9-a75f-0f043eb73579)

* To traverse the list of StartupParameters provided by the user, add and define another action as follows:&#x20;
  1. Select Action as “Traverse List”.&#x20;
  2. Select List as “StartupParameters”.&#x20;
  3. The Variable “item” is created.

![](https://2351945889-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVoxOh7gdjWdmqooFdYBY%2Fuploads%2FbfGh8xKDvtYlJQvGzcBl%2FONReadingRecord_TraverseList.png?alt=media\&token=b9a5c576-d238-40f4-a0ba-a9113bbc6dfb)

* 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”:&#x20;
  1. Select Action as “Condition action”.&#x20;
  2. Enter the Label as “if Customer\_ID equals item”.

![](https://2351945889-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVoxOh7gdjWdmqooFdYBY%2Fuploads%2FEKddmRQLKtVBnDC92BpL%2FTL_ConditionActionLabel.png?alt=media\&token=fa502e4a-9dd0-40fa-b1e7-bfdb02100bc8)

* 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:&#x20;
  1. Select Target Value as “reader.Customer\_ID”.
  2. Select Operator as “Is Equal”.&#x20;
  3. Select Source as “item”.

![](https://2351945889-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVoxOh7gdjWdmqooFdYBY%2Fuploads%2FWfVcja8Ki8XLulgJPoTY%2FTL_ConditionAction_Criteria.png?alt=media\&token=568ceb9d-38f7-46b8-8b59-4fc68cbdea25)

* To define actions if the criteria is returned as True, in the Code tab>On True section, add and define the following actions:&#x20;
  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)&#x20;
  3. Action: “Break List traverse”(break the loop once all Customer\_IDs are traversed and verified)

![](https://2351945889-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVoxOh7gdjWdmqooFdYBY%2Fuploads%2F0tJ9Css4y5COIvX1iA0J%2FTL_ConditionAction_Code_OnTRUE.png?alt=media\&token=dd6bdb78-e263-435f-bad3-8385d12fd830)
