web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Attempting to loop thr...
Power Automate
Answered

Attempting to loop through web form controls by incrementing UI Element referenced

(0) ShareShare
ReportReport
Posted on by 2

I have a Desktop flow where I am trying to loop through web form elements (rows), but I can't find a place to use a counter to iterate through the form rows.

 

Ideally I'd like to set a counter variable that iterates through the rows until completed.

Currently, the repetitive section of the flow logic sans-loop looks like the following:

 

Click link on web page - Click on Image 'pt1:..._lnk::icon' of web page

Click link on web page - Click on Span 'Stay Details' of web page

Click link on web page - Click on Span 'Edit' of web page

Click link on web page - Click on Anchor 'Search and Select Type' of web page

Click link on web page - Click on Span '02' of web page

Click link on web page - Click on Span 'Select' 3 of web page

Click link on web page - Click on Span 'Save' of web page

Click link on web page - Click on Anchor 'Close' of web page

--------------2nd row-----------------------------------------

Click link on web page - Click on Image 'pt1:..._lnk::icon' 2 of web page

Click on Span 'Stay Details' 2 of web page

...

 

The above commands are exactly the same except that the UI Elements referenced increases by 1 ("Image 'pt1:..._lnk::icon'" goes to "Image 'pt1:..._lnk::icon' 2" to "Image 'pt1:..._lnk::icon' 3" and so on), but I can't find a way to use a counter to append a numeric value to the UI Element name.

  • Verified answer
    DeepaliJagtap Profile Picture
    68 on at

    Hey,

    you can use counter(loopindex) variable in loop and use same in selector of specific Ui-element by keeping text editor toggle ON, as shown in below image :

    DeepaliJagtap_0-1704786409535.png

    Then you will get next window where you can use counter variable by clicking on {x} select variable  while cursor being on required attribute of selector e.g. If you want to use variable for Id="user" in below example then select user word and select counter(i.e. loopindex) variable using {x}.

     

     DeepaliJagtap_1-1704786528123.png

     

    In your case use it like "Image 'pt1:..._lnk::icon' %loopindex%"

    Please mark this as solution if it helps you solve issue. Happy to help you more.

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    Can you inspect the elements via the browser developer tools and share a screenshot of what it looks like in the overall page structure?

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 307 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 289

#3
Henil Profile Picture

Henil 127

Last 30 days Overall leaderboard