cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mundy727
New Member

Compare 2 columns in same list with multiple values in 1 column

Hi,

 

I am attempting to build a flow to notify me when a new Sharepoint list item is created, it will detect that a value matches another item such as example below (Item #3 contains the same value in ID set 2 as item #1 - 12344). In this SP list, there are multiple values separated by commas. Example shown in the table below.

 

My flow so far is as follows, I'm just hung up on the formula to use to capture this or if this is possible? My first time posting here appreciate any assistance And guidance!

 

Flow

1.) When an item is created --> site address an SP list name used

2.) Get items --> from SP list from #1

3.) apply to each --> value 

4.) condition --> if ID Set 2 contains EXPRESSION HERE

5.) Send email

 

Item #ID set 1ID set 2
31234512344
21223214567, 12456
11345612654, 12344
5 REPLIES 5
annajhaveri
Super User
Super User

@mundy727  could you please let me know what is the data type of ID set 2 column in the list? Is it single line of text with values separated by comma or multiple choice field?

Regards,
Anna Jhaveri

If I have answered your question, please mark the post as Solved to help other users to identify the correct answer
If you like my response, please give it a Thumbs Up.

Thanks Anna, 

 

Its single line of text with values separated by comma

AnthonyAmador
Microsoft
Microsoft

Hi @mundy727 

 

I think one way to achieve this is converting the single line of text to a string and separate the numbers into an array then make another array with the ID Set 2 of each item and compare the two arrays.

 

AnthonyAmador_0-1622584618017.png

AnthonyAmador_1-1622584635611.png

AnthonyAmador_2-1622584736466.png

AnthonyAmador_3-1622584756172.png

 

Probably there is a better solution for this, if someone have any idea feel free to join. 

 

Cheers. 

 

 

@mundy727  so you want to get value of IDSet2 from current item (which is newly created) and compare IDSet2 values with other items in the list, if yes, then do following:

 

1. Add Compose action and configure below expression in compose action

split(triggerOutputs()?['body/IDSet2'],',')

annajhaveri_0-1622624764781.png

 

2. Then add Apply to each action and configure to use outputs of above compose action in the apply to each action

annajhaveri_1-1622624774490.png

 

3. Then add Get Items action inside the apply to each action and configure it as shown below, select SharePoint site, List and provide the filter queyr as shown in below screenshot

annajhaveri_2-1622624813514.png

4. Now again add Apply to each action to loop through items fetched by Get Items, use value(list if items) from Get Item dynamic content here

annajhaveri_3-1622624879916.png

 

5. Now if you want to send email for each match individually then add Send email action under the second apply to each action. But if you want to send one email which has details of all of the matching items found in the list, then you have to store all matching item details in variable and add send email action at the end of the flow.

 

Full flow screenshot below and guidelines of sending email added as comments in below screenshot

annajhaveri_4-1622625325374.png

 

 

Regards,
Anna Jhaveri

If I have answered your question, please mark the post as Solved to help other users to identify the correct answer
If you like my response, please give it a Thumbs Up.

Thanks Anna! I will give this a try. Appreciate your help here.

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.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Top Solution Authors
Users online (983)