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

![](/files/Qe8M1AuoMTFb1rn9Tb7v)

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

![](/files/4HWCELzuuBK7abiyPSW8)

* 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()”.

![](/files/DwkMdNDfXJDWmTsxOvKG)

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

![](/files/BMo5PVAXcj19YhKyKfET)

* 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”.

![](/files/kDlt4P15LKsZzVLBZzc2)

* 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”.

![](/files/v22zVLFNtftPX6Dj8oq0)

* 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)

![](/files/nq66pP0Nrine0DgvE5E3)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.langstack.com/welcome/get-started/learn-langstack/introduction-to-etl-pipeline/exercise-1-skip-customer-records/step-2-skip-records-based-on-customer_id.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
