cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dwalker97
Helper II
Helper II

Contains() expression between two arrays

I have two arrays, ManipulatedStrings and AllAccounts. I am searching to get any ManipulatedStrings items that are contained in an array called AllAccounts. This individual process in my flow takes roughly 1 hour to find each true output. AllAccounts has 5000 rows, and my ManipulatedStrings array stores 5 for this example. It took me 5.5 hours to run this as a test ‌‌


This is what it looks like currently: 

 

 

dwalker97_0-1622123002312.png

dwalker97_1-1622123048080.png

dwalker97_2-1622123145298.png

 

Can anybody help me with this? Is there any quicker way of doing this? Im not sure why this takes so long. 

 

Thanks!

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

@Expiscornovus , I have found the solution to my own problem! 😁

 

Iterate through each array item (SearchAccounts = ManipulatedStrings in below screenshot), I changed the naming. 

 

The output of each iteration provides me with results of contain! Much quicker than my original post also.

 

dwalker97_0-1622195692090.png

 

View solution in original post

4 REPLIES 4
Expiscornovus
Super User
Super User

Hi @dwalker97,

 

If the structure of both of your arrays are the same you could try and use the intersection function to find the items both collections have in common:

https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#i...

 

Let me know if that works for you.

 



Happy to help out! 🙂

Interested in more #PowerAutomate #SharePointOnline or #PowerVirtualAgents content?
Visit my blog, Subscribe to my YouTube channel or Follow me on Twitter


Hey @Expiscornovus , in my flow I am making two searches. One is for Exact Matches, where I am using the intersection function and works perfect. The above problem is where I am trying to find Possible Matches, so it is different because I need to find array rows that may contain my ManipulatedStrings item. 

 

For example, 'Company A' is an item in ManipulatedStrings. If there is a 'Company A Ltd' in AllAccounts, it will be a possible match and written to my excel sheet, hence the contains expression 🙂 Thanks!

Expiscornovus
Super User
Super User

Hi @dwalker97,

 

Sorry, I missed the 'possible match' part of your requirement. You are right, my suggestion only works with exact matches.

 

Let me go back to the drawing board to see if I can find another approach 😁



Happy to help out! 🙂

Interested in more #PowerAutomate #SharePointOnline or #PowerVirtualAgents content?
Visit my blog, Subscribe to my YouTube channel or Follow me on Twitter


@Expiscornovus , I have found the solution to my own problem! 😁

 

Iterate through each array item (SearchAccounts = ManipulatedStrings in below screenshot), I changed the naming. 

 

The output of each iteration provides me with results of contain! Much quicker than my original post also.

 

dwalker97_0-1622195692090.png

 

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Users online (3,993)