How to Process Rows in a Power Automate Desktop Loop
Question details
The user needs to resolve an issue where a Power Automate Desktop flow processes only the first transaction row and fails to continue to subsequent rows.

- Product
- Power Automate Desktop
- Device & OS
- not provided
- Scenario
- Automating repetitive data entry or processing tasks involving multiple rows of transaction data.
- Observed behavior
- The flow successfully processes the first row, compares data, and clicks the confirmation control, but stops or fails before processing the next row.
Before modifying your flow, ensure you have saved a backup copy of the current desktop automation script and review the extracted variables used in your loop.
Adjust Loop Structure and Refresh Variables
Correct the loop action and ensure that row data variables are refreshed during each iteration to process all rows successfully.
A common reason for flows stopping after the first row is that the actions are not properly nested within the loop container, or the variables referencing the data are not updating dynamically.
Verify that all actions related to comparing data and clicking the confirmation control are nested correctly inside a 'For each' or 'Loop' action in the Power Automate Desktop workspace.
Ensure that any actions extracting element details or reading the current row's data are placed inside the loop so they automatically update with the new row's data upon each iteration.
Add a 'Wait' or 'Wait for window content' action at the end of the loop to ensure the confirmation control resets or the next row becomes visible before the next loop iteration begins.

Handle Your Data Easily with WPS Office
While troubleshooting complex automation flows, you need a reliable suite to manage your underlying transaction data. WPS Office is a free, lightweight, and highly compatible alternative to Microsoft Office, perfect for managing spreadsheets and documents used in your automations.

Frequently Asked Questions
Why does my Power Automate Desktop flow stop after the first loop iteration?
This usually happens if the data variables aren't refreshed inside the loop or if the UI element selectors are hardcoded to the first row's index instead of being set to dynamic variables.
How do I make UI element selectors dynamic in a loop?
You can edit the UI element's selector in the Power Automate Desktop UI elements pane. Replace the static row index or name with the current loop index variable (such as %LoopIndex% or the current item variable).
Can I process spreadsheet rows directly using Power Automate Desktop?
Yes, you can use the 'Read from Excel worksheet' action to read your spreadsheet data into a datatable variable. Then, insert a 'For each' loop action to iterate through every row in that datatable efficiently.




