cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dwalker97
Helper II
Helper II

DO-UNTIL Variable value equals another Variable

I am reading in the value of a text file and storing it as 'StopAtInquiryID', in this example it is 1000.

 

I then read in the rows of a table called 'IDs' and would like to set each row to the variable 'TestID'. I would like each ID to be processed until the TestID reaches 'StopAtInquiryID' value. Although I have not seemed to get this to work.

 

dwalker97_0-1618927419086.png

 

 

I want each valid ID to be added to a new table, and exit this loop once the do-until condition is met.

 

Any help is appreciated. Thanks

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
DamoBird365
Microsoft
Microsoft

Hi @dwalker97 

 

How about you use a filter array on your list of ID's where the ID is less than or equal to StopAtInquiryID, then create an apply to each on your filter array results as this will not contain ID's above the StopAtInquiryID value.

 

The problem with your solution is a loop within a loop.

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Cheers,
Damien


P.S. take a look at my new blog here

View solution in original post

4 REPLIES 4
DamoBird365
Microsoft
Microsoft

Hi @dwalker97 

 

How about you use a filter array on your list of ID's where the ID is less than or equal to StopAtInquiryID, then create an apply to each on your filter array results as this will not contain ID's above the StopAtInquiryID value.

 

The problem with your solution is a loop within a loop.

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Cheers,
Damien


P.S. take a look at my new blog here

Hi @DamoBird365 , this works for me.

 

I am now trying to loop through each filtered result in a For Each loop. How do I reference each item? I have tried items('Apply_to_each_2')?['ID'] but this just throws an error. Any help is appreciated, thanks!

Can you share what you have built so far?  

 

Thanks

 

Damien

dwalker97
Helper II
Helper II

@DamoBird365 not to worry, I have got it. Seems all I needed to have was item(). Thanks a lot for you help!

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Users online (1,865)