How to dynamically set a variable in a For Loop based on Excel row values in RPA?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2025 10:53 PM
Hi everyone,
I’m working on a use case in ServiceNow RPA, where I’m reading an Excel file using the Data Table connector and looping through rows using a For Loop (not “For Each Row”).
Inside the loop, I’m using Get Cell Value to extract values like:
Cost
Approval
✅ My Requirement:
If Cost > 500, the approval should go to the person in the Approval column.
If Cost <= 500, the approval should still go to the person in the same Approval column (the value changes for each row).
The Issue:
In my current flow:
I get the values of Cost and Approval for the first row using Get Cell Value.
Then it goes into a Decision block that checks if the cost is greater than 500.
If true, I update the queue and send approval (this part works).
If false, it also updates the queue — but here’s the issue: the Approval value used is still from the earlier (true) case. It doesn’t update for the current row.
It seems like the variable or data isn't updating properly inside the loop for the false path. I’m not able to dynamically reassign the Approval value per row during each iteration.
What I Need Help With:
How do I ensure the Approval value (from Excel) is fetched fresh for each row inside the loop?
Where exactly should I store or update this variable so both conditions (true/false) get the correct approver value?
Thanks in advance for your help!