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 Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (5,509)