Showing results for 
Search instead for 
Did you mean: 

MS Flow - Elements contained in text



I have an issue where I need some help. My issue is as follows:

1. I have a string variable that contains some text. 


Blablabla 12345, 22222

2. Then I have another string that I extracted from an array. 


12345, 22222, 98909



I want to check whether the elements from no 2 are contained in no 1


There are too many combinations. As an example, I can exact 12345 from no 2 and then find that this is included in no 1. But then I want to know if also 22222 is included in no 1 and also the third element. It might be the case that only 22222 is included in no 1 or 22222 and 98909 but not 12345.



Is there a smart way to check which of the elments from no 2 are included in no 1 with the help of MS Flow?


Would be great if somebody could help.

Many thanks in advance.




Hi @lreinhard7 


What you can do is, you already have two arrays. 

lets us name them as Array 1 and Array 2. 

You want to check what all elements of array 2 are included in array 1. 


First, initialise a 3rd array and leave the value blank. Now add an action apply to each and in this put the array2. within the apply to each, add a condition and on the left put the array 1 and the operator will be contains and on the right side put current item. In the yes branch add an action -> append to array variable and then select the third varaiable name and the value is current item. 


This way you will get all the elements of array 2 contained in array 1 in the array 3. You can create an array 4 and put that in the no branch to get the elements of array 2 that are NOT contained in array 1. Makes sense?


Hope this Helps!


If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Helpful resources

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

The Super User program for 2022- Season 2 has kicked off!

Users online (3,451)