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 / Getting rows from an E...
Power Automate
Unanswered

Getting rows from an Excel sheet and filter for those containing ANY value from an array

(0) ShareShare
ReportReport
Posted on by 27

Hi all,

 

I'm a bit stuck and hope you can help.

 

I do have an array variable with some values: ["test1","test2","test3"]

I also have an Excel sheet with a few columns: "email address" and "array" where the array could be ["test1","test2","test3"] or ["test1","test3"] or ["test3"]

 

I would like to get all "email addresses" from any row which contains any of the values in the array variable.

Those should be stored in a string variable "BCC" to send an email.

 

I could run a "Filter array" in a loop for each value in the array variable but since I am then again running another loop to add the email addresses returned to the BCC variable and the list is going to be rather big, this will take forever.

 

Surely, there must be a better way of doing this but I am not seeing it 🙂

 

Thank you!

Categories:
I have the same question (0)
  • v-yiwenxie-msft Profile Picture
    Microsoft Employee on at

    Hi @ThoSt 

     

    I'm not quite sure about your need.

    In my understanding, your excel have two columns 'email address' and 'array'. And the values in these two columns look like this:

    2.4-11.PNG

     

    You want to get email addresses contains any value separated by , from array column.

     

    If I've misunderstood your need, please feel free to let me know and please take a screenshot of your flow and excel structue with private info covered up?

     

    Best Regards,
    Community Support Team _ Kira Xie
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • ThoSt Profile Picture
    27 on at

    Hi @v-yiwenxie-msft,

     

    this is how the Excel sheet looks:

    Capture.PNG

     

    If my array variable is ["test1"] then I would like to have the email address from A2 and A4.

    If my array variable is ["test2","test3"] then I would like to have the email address from A2, A3 and A4.

    Basically return the "email" if array contains "any value from the array variable".

    The returned email addresses should then be added to a string variable, separated by a semicolon.

     

    Hope this clears things up a bit 🙂

  • v-yiwenxie-msft Profile Picture
    Microsoft Employee on at

    Hi @ThoSt 

     

    In my understanding, you want to have those specific email addresses according to the value in the ‘array’ column.

     

    If I’m misunderstanding your need, please could you tell me whether there is another array variable? Is it an initialized variable in Flow using the step ‘initialize variable’? And could you take a screenshot of detailed steps of your flow?

     

    If I’m not misunderstanding your need, you could try the flow as below:

    2.9-6.PNG

    The action ‘Condition’ only supports string and integer, if you just use [“test1”] here, the flow will automatically recognize it as array and will get error. So, [“test1”] should be converted into string.

     

    The detailed steps for ‘If yes’ in ‘Condition’:

    2.9-7.PNG

    The functions used:

    outputs('List_rows_present_in_a_table')?['body/value'][0]['email addresses']

    outputs('List_rows_present_in_a_table')?['body/value'][2]['email addresses']

    concat(outputs('Compose'),';',outputs('Compose_2'))

     

    The meanings for these three functions here:

    Compose: get the email addresses from A2

    Compose2: get the email addresses from A4

    Send an email: combine two email addresses separated by semicolon

     

    The detailed steps for ‘If no’ in ‘Condition’:

    2.9-8.PNG

     

    The detailed steps for ‘If yes’ in ‘Condition 2’:

    2.9-9.PNG

    The functions used:

    outputs('List_rows_present_in_a_table')?['body/value'][0]['email addresses']

    outputs('List_rows_present_in_a_table')?['body/value'][1]['email addresses']

    outputs('List_rows_present_in_a_table')?['body/value'][2]['email addresses']

    concat(outputs('Compose_3'),';',outputs('Compose_4'),';',outputs('Compose_5'))

     

    Best Regards,
    Community Support Team _ Kira Xie
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • ThoSt Profile Picture
    27 on at

    Hi @v-yiwenxie-msft,

    thanks for your detailed response but I dont think this will work. The array variable can contain up to 7 (possibly more in future) values and the email address list several thousand entries.

    Initially I did loop through the email address list and wrote the email address into another string variable (BCC) whenever the array field in Excel contained "string(current_item)".

    This worked but was terribly slow as I needed to loop through 20k addresses, 7 times and several of those appeared multiple times as the array column could contain all 7 array items in the worst case.

     

    So, my thought was to keep it simple and either use "filter array" or even an ODATA filter in the "List rows present in a table" function to only show those rows where ANY of the array values is in the array column.

  • v-yiwenxie-msft Profile Picture
    Microsoft Employee on at

    Hi @ThoSt 

     

    Could you show me the screenshot of your flow?

    How many loops do you have?

     

    Best Regards,
    Community Support Team _ Kira Xie
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

     

  • ThoSt Profile Picture
    27 on at

    Sure!

    ThoSt_1-1612944123104.png

     

    So, in the current case I have 7 deployments, so I am looping through the whole mailing list 7 times to get all the email addresses I need. It works, but it's slow even with only 50 items in the mailing list.

     

    Edit: I realized that there appears to be a looping limit as well at 256?

  • ThoSt Profile Picture
    27 on at

    This can be closed. I never got this to work 100% but was hitting other limits. Thus I had to use an external mailing list.

     

    Thanks for your help though! I've learnt something I can re-use later 😉

     

    Thomas

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 250 Super User 2026 Season 1

#2
Expiscornovus Profile Picture

Expiscornovus 222 Most Valuable Professional

#3
Haque Profile Picture

Haque 174

Last 30 days Overall leaderboard