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 / How to I stop comparin...
Power Automate
Unanswered

How to I stop comparing tables once a match is found?

(0) ShareShare
ReportReport
Posted on by 25

I have two tables in Dataverse.  One is populated from a legacy ERP system, another is populated from a spreadsheet compiled from multiple vendor inputs.  I need to compare the two tables to find rows where, for example, Table1.Field1 matches Table2.Field2.  

 

The method I have been using to do this is to:
    List Rows for Table1
    Apply to each row in Table1
       List rows  for Table2

       Apply to each row in Table2

          Condition

 

While this works well with limited amounts of data in testing, our real world tables can have thousands of rows.  I would like a way for the comparison to stop if a match is found.  

 

I thought I could use a Do Until but I have not found a configuration stops the loop when a match is found.  If Do Until is not the right action to use, can anyone tell me how to break out of the second Apply to Each when the match is found?

Categories:
  • Mister_Shaik Profile Picture
    1,008 on at

    Hi @msimmonds ,

     

    For the second "List Rows present in a Table" action, you can apply a filter condition instead of getting all the items and applying the filter separately. This would help reduce the loop for the second "Apply to each" action.

     

    In case you are not able to perform the filter conditions directly on the filter query, then you can opt for a "Do Until" loop instead of an "Apply to Each". The condition for DoUntil to keep running is, IndexPointer Variable should be less than number of items in Table 2. You can use a IndexPointer variable to keep track of current item to check in loop 2 and when the condition matches, just set the value of IndexPointer to Length of Table 2 +1 , so that the DoUntil loop breaks out.

     

    1. Break out.PNG

     

    Hope you find this helpful!

     

    Kind Regards,

    Shaik Sha
    ________________________________________________________________________

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

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
Mohsin Ali Profile Picture

Mohsin Ali 355

#2
11manish Profile Picture

11manish 336 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 308

Last 30 days Overall leaderboard