cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
scottgm
Level: Powered On

Searching text field for values in my array

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

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

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,

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

View solution in original post

2 REPLIES 2
Super User
Super User

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



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!



Community Support Team
Community Support Team

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,

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

View solution in original post

Helpful resources

Announcements
firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

firstImage

Coming Soon: T-shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Top Solution Authors
Top Kudoed Authors
Users online (5,020)