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

How to query a item from excel or array and use this item to do condition judge?

Hi  all:

 

Recently, i create a flow and need to  query a item from excel or array and use query result to to do condition judge.

Would you please tell me how to do?

 

Thanks a lot:)

1 ACCEPTED SOLUTION

Accepted Solutions
Gopala_Krishna
Super User
Super User

@Jackywei_BDF 

For querying the array items you can make use of the FILTER ARRAY action in Power Automate, in that action you can query the array, by passing conditions and a result would be provided as result that satisfies the specified condition.

Gopala_Krishna_0-1634106500813.png

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

If the information shared helps you, please consider giving a thumbs up 👍 and mark solution as resolved

View solution in original post

11 REPLIES 11
Gopala_Krishna
Super User
Super User

@Jackywei_BDF 

For querying the array items you can make use of the FILTER ARRAY action in Power Automate, in that action you can query the array, by passing conditions and a result would be provided as result that satisfies the specified condition.

Gopala_Krishna_0-1634106500813.png

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

If the information shared helps you, please consider giving a thumbs up 👍 and mark solution as resolved

View solution in original post

CFernandes
Super User
Super User

Hello @Jackywei_BDF 

 

You can Filter Array - The idea is to  -

 

  • Add a "Get rows" action, specify File and Worksheet.
  • Add a "Filter array" action.
  • set to output of "Get rows" action in Filter array action, within Condition box set your condition.

For details see - https://powerusers.microsoft.com/t5/Building-Flows/How-do-I-filter-data-in-Flow/td-p/95823?lightbox-...

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

 

Hi    CFernandes:

 

Thanks for your help:)

now the situation is i want to get user's manager by get manager.

After i get the manager's email address , i need to compare it with a excel.

If the manager's email address in excel then we will start an approval, if not i need to get manager's manager and compare his email address with excel sheet again.

Would you please tell me how to achieve this point?

 

Thank you very much in advance:)  

 

Hey @Jackywei_BDF 

 

Can you try the below -

 

CFernandes_0-1634116932929.png

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

 

P.S. take a look at my blog here and like & subscribe to my YouTube Channel thanks.

 

 

Hi :

Thanks for your sharing.

Unfortunately, i met a problem about excel online can't find table.

I will show you my flow and setting, please help me solve it.

Jackywei_BDF_0-1634134438644.png

Actually, the excel and table are available in document library.

Jackywei_BDF_1-1634134555295.pngJackywei_BDF_2-1634134587095.png

In the end, the excel online connector is OK.

Jackywei_BDF_3-1634134697111.png

Thanks a lot:)

 

 

Hey @Jackywei_BDF 

 

I do not see a Table in your Excel file -

 

Here are the steps to create an Excel table.

 

There is also a video from MS to walk you through here

 

  1. Select a cell within which you want to add your data.

  2. Select Home > Format as Table.

  3. Choose a style for your table.

  4. In the Create Table dialog box, set your cell range.

  5. Mark if your table has headers.

  6. Select OK.

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

 

P.S. take a look at my blog here and like & subscribe to my YouTube Channel thanks.

Hi: CFernandes

 

Thanks for your guide and video.

I format excel data as a table, please take a look from screenshot.

You will see i have a table named as manager and i set header as Email address.

Jackywei_BDF_0-1634176784530.png

Unfortunately, i still get same error as below.

Jackywei_BDF_1-1634177278968.pngJackywei_BDF_2-1634177306583.png

I don't know where is the wrong place, would you please help me?

 

Thank you very much:)

 

 

Hi  CFernandes:

 

I have solved the issue by myself😀

It is working after i modify table name as sheet1 and i choose table name as default “表1” in flow.

 

I have another question:

i need to do condition adjust if email address is in table list i will go left path A, if email address is not in table list, i should go right path B.

now i can just filter email address from array but i can't do decision go left or go right.

How to get it?

 

Thank you:)

Filter Array will return an array of values - You need to use the condition with the loop -

 

For details see - https://manueltgomes.com/microsoft/powerautomate/multiple-conditions-in-filter-array/ 

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

 

P.S. take a look at my blog here and like & subscribe to my YouTube Channel thanks.

Hi :

Yes, I have got it.

I should initial a variable and use it as condition to adjust  go path A or path B.

I learned more from you

Thank you so much & Have a nice weekend:) ~

 

 

Hi  CFernandes:

I have another question for array, the situation is i set a variable as email address and i got a array from a table, now i need to append table content to this variable, how to write the JSON value?

 追加到数组.JPG

 

Thank you very much in advance:)

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (1,091)