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 Platform Community / Forums / Power Automate / Searching text field f...
Power Automate
Unanswered

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

 

Categories:
I have the same question (0)
  • abm abm Profile Picture
    32,856 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 497 Moderator

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 477 Super User 2025 Season 2

#3
chiaraalina Profile Picture

chiaraalina 242

Last 30 days Overall leaderboard