cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
BradyMason
Frequent Visitor

Fetching Row from Excel Table after a Row Containing a Certain Value or String

I want to fetch a row from an excel table that comes directly after a previous row containing a value or string I have already fetched.
So if row 'x' contains the string "John" then I can fetch Row 'x+1'.  I know there should be Compose syntax to do this but I am unsure of what to use.

Does anyone know what I should use?  Is there a way to use Compose to get the row with Contains to find the row after?

1 ACCEPTED SOLUTION

Accepted Solutions
eric-cheng
Solution Sage
Solution Sage

Hi @BradyMason ,

 

The output value of List rows present in a table should be an array.

 

You could:

 

1) Initialize a number variable to use as a counter

2) Use a Do Until and loop through the rows of the array with a condition of x contains John and increment the variable

3) When it matches the condition, it should have exited the loop.  Add 1 or 2 to your variable and then reference the row of your array using the index.

 

--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up

Connect on LinkedIn

View solution in original post

2 REPLIES 2
eric-cheng
Solution Sage
Solution Sage

Hi @BradyMason ,

 

The output value of List rows present in a table should be an array.

 

You could:

 

1) Initialize a number variable to use as a counter

2) Use a Do Until and loop through the rows of the array with a condition of x contains John and increment the variable

3) When it matches the condition, it should have exited the loop.  Add 1 or 2 to your variable and then reference the row of your array using the index.

 

--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up

Connect on LinkedIn

BradyMason
Frequent Visitor

That's a great idea.  The other solution I thought of last night was to add a column with a number and create a new index that I could just increment by one.  So I could search for "John" find his number in the column was x then search for x+1 to find the name of the person in that row.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Users online (2,859)