cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
scottgm
Frequent Visitor

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
v-bacao-msft
Community Support
Community Support

 

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
abm
Super User III
Super User III

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!

Learn more from my blogPower Automate Video Tutorials
v-bacao-msft
Community Support
Community Support

 

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
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Solution Authors
Users online (3,140)