web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Searching text field for values in my array

(0) ShareShare
ReportReport
Posted on by 10

Hello Experts, 

 

I have an array set up with a list of different site codes, for example:

 

SiteA01

SiteB01

SiteB02

SiteC01

...and so on

 

I also have an action to pull rows from a SQL server and I want to add a condition to find all rows where any of the array values are present anywhere my "summary" column. The summary column is varchar and the content varies from row to row. Here are a few examples:

 

Update firmware on SiteC01.hostname.com 

2hr downtime for UPS maintenance

WLC update at SiteA01

siteb01 switch upgrade

 

I would only expect to capture rows 1, 3 and 4 in this case. 

 

Can anyone advise if it is possible to use an expression in the contains condition to achieve this?

 

FlowCondition.jpg

 

I have the same question (0)
  • abm abm Profile Picture
    32,585 Most Valuable Professional on at
    Re: Searching text field for values in my array

    Hi @scottgm 

     

    In your apply each loop add another apply each for the array. Iterate each array value. Add the the If condition to check the array value contains sql value.

     

    Also you could use filter array action to check against the sql rows.

     

    Have a look at this blog

     

    https://veenstra.me.uk/2018/12/18/microsoft-flow-filter-data-in-an-array/

     

    Thanks

  • Verified answer
    v-bacao-msft Profile Picture
    on at
    Re: Searching text field for values in my array

     

    Hi @scottgm ,

     

    Please try the following methods to achieve your needs.

    • Initialization variables store sitecodes in an array.
    • Iterate through the Get rows action and use the Filter array to filter and determine whether the current row meets the conditions.
    • The condition is whether the specified column value contains any element in the Sitecodes variable.
    • If the body of the Filter array is not empty, the current row is eligible.

    Image reference:

    94.PNG

     

    Best Regards,

  • marpio Profile Picture
    on at
    Re: Searching text field for values in my array

    These are painful and horribly slow... It is better to covert the array (or the interested part of it) into a string and then search in the "big" string.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 722 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 461 Moderator

#3
developerAJ Profile Picture

developerAJ 283

Last 30 days Overall leaderboard