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 / End loop after last ta...
Power Automate
Answered

End loop after last table row reached

(0) ShareShare
ReportReport
Posted on by 72

Have everything working in my PAD process with the exception of determining how to set the end value of my loop action in PAD. I am using a "Get Details of element on web page" to get a certain value in a table row from the UI. I am using a loop to pass the loop counter value to the span element in my UI element. But the number of rows will always be dynamic and when the loop encounters the end of the rows it throws an error "Failed to retrieve attribute of UI element on web page". Wanted to get some input on best way to handle this or get the row count to pass as a variable to the loop.  

 

lkhall_37203_0-1691155750361.png

 

I have the same question (0)
  • Verified answer
    Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    Use the If web page contains and check if the element does not exist. If it does not, use Exit loop to stop looping.

    -------------------------------------------------------------------------

    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

     

    I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.

  • lkhall_37203 Profile Picture
    72 on at

    Thank you for the suggestion but I think I am missing where to put the Exit Loop. Did as you suggested and put a "If web page contains" inside my loop" and restricted my result set to 50 records. and it checks just fine but when I get to record 51 it still runs the outside loop which I get so how would I tell the outer loop to "exit" 

     

    lkhall_37203_0-1691158001669.png

     

  • lkhall_37203 Profile Picture
    72 on at

    well definitely helps when I finally realize there is an else block that can be added thanks for the help go me going.  

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    You could have set your If web page contains action to check for the web page to not contain the element. And then simply have the Exit loop inside the condition.

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 481

#2
11manish Profile Picture

11manish 278

#3
David_MA Profile Picture

David_MA 276 Super User 2026 Season 1

Last 30 days Overall leaderboard