cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dlprentice
Resolver II
Resolver II

How to consolidate array entries based on a duplicate value?

Using the below array as an example I am trying to send 1 email to "someemail@gmail.com" with a table of the elements "System", and "Acronym". I am not sure how to do this, any help is appreciated.

 

 

[
 {
      "System": "Contaminant Assessment Process",
      "Acronym": "CAP",
      "Primary Contact Email": "someemail@gmail.com"
    },
    {
      "System": "Contaminants Investigations Database",
      "Acronym": "CID",
      "Primary Contact Email": "someemail@gmail.com"
    },
    {
      "System": "Pesticide Use Proposal",
      "Acronym": "PUPS",
      "Primary Contact Email": "someemail@gmail.com"
    },
    {
      "System": "Refuge Cleanup Projects",
      "Acronym": "RCP",
      "Primary Contact Email": "someemail@gmail.com"
    }
]

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Paulie78
Super User III
Super User III

Go into your flow, choose to add a new step, go to "My Clipboard" and then copy the below into your clipboard and press CRTL-V. I've put everything you need into a scope which you can just paste.

{"id":"9952de8f-baf0-45b5-bc5a-af04-a68dcd62","brandColor":"#8C3900","connectionReferences":{},"connectorDisplayName":"Control","icon":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHZlcnNpb249IjEuMSIgdmlld0JveD0iMCAwIDMyIDMyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPg0KIDxwYXRoIGQ9Im0wIDBoMzJ2MzJoLTMyeiIgZmlsbD0iIzhDMzkwMCIvPg0KIDxwYXRoIGQ9Im04IDEwaDE2djEyaC0xNnptMTUgMTF2LTEwaC0xNHYxMHptLTItOHY2aC0xMHYtNnptLTEgNXYtNGgtOHY0eiIgZmlsbD0iI2ZmZiIvPg0KPC9zdmc+DQo=","isTrigger":false,"operationName":"Scope","operationDefinition":{"type":"Scope","actions":{"JSON":{"type":"Compose","inputs":[{"System":"Contaminant Assessment Process","Acronym":"CAP","Primary Contact Email":"someemail@gmail.com"},{"System":"Contaminants Investigations Database","Acronym":"CID","Primary Contact Email":"someemail@gmail.com"},{"System":"Pesticide Use Proposal","Acronym":"PUPS","Primary Contact Email":"someemail@gmail.com"},{"System":"Refuge Cleanup Projects","Acronym":"RCP","Primary Contact Email":"someemail@gmail.com"}],"runAfter":{}},"email":{"type":"Compose","inputs":"@first(outputs('JSON'))['Primary Contact Email']","runAfter":{"JSON":["Succeeded"]}},"Select":{"type":"Select","inputs":{"from":"@outputs('JSON')","select":{"System":"@item()['System']","Acronym":"@item()['Acronym']"}},"runAfter":{"email":["Succeeded"]}},"Create_HTML_table":{"type":"Table","inputs":{"from":"@body('Select')","format":"HTML"},"runAfter":{"Select":["Succeeded"]}}},"runAfter":{}}}

View solution in original post

4 REPLIES 4
Paulie78
Super User III
Super User III

Do you mean System and Acronym?

Yes, thanks for catching that, I've edited it to be correct.

Paulie78
Super User III
Super User III

Go into your flow, choose to add a new step, go to "My Clipboard" and then copy the below into your clipboard and press CRTL-V. I've put everything you need into a scope which you can just paste.

{"id":"9952de8f-baf0-45b5-bc5a-af04-a68dcd62","brandColor":"#8C3900","connectionReferences":{},"connectorDisplayName":"Control","icon":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHZlcnNpb249IjEuMSIgdmlld0JveD0iMCAwIDMyIDMyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPg0KIDxwYXRoIGQ9Im0wIDBoMzJ2MzJoLTMyeiIgZmlsbD0iIzhDMzkwMCIvPg0KIDxwYXRoIGQ9Im04IDEwaDE2djEyaC0xNnptMTUgMTF2LTEwaC0xNHYxMHptLTItOHY2aC0xMHYtNnptLTEgNXYtNGgtOHY0eiIgZmlsbD0iI2ZmZiIvPg0KPC9zdmc+DQo=","isTrigger":false,"operationName":"Scope","operationDefinition":{"type":"Scope","actions":{"JSON":{"type":"Compose","inputs":[{"System":"Contaminant Assessment Process","Acronym":"CAP","Primary Contact Email":"someemail@gmail.com"},{"System":"Contaminants Investigations Database","Acronym":"CID","Primary Contact Email":"someemail@gmail.com"},{"System":"Pesticide Use Proposal","Acronym":"PUPS","Primary Contact Email":"someemail@gmail.com"},{"System":"Refuge Cleanup Projects","Acronym":"RCP","Primary Contact Email":"someemail@gmail.com"}],"runAfter":{}},"email":{"type":"Compose","inputs":"@first(outputs('JSON'))['Primary Contact Email']","runAfter":{"JSON":["Succeeded"]}},"Select":{"type":"Select","inputs":{"from":"@outputs('JSON')","select":{"System":"@item()['System']","Acronym":"@item()['Acronym']"}},"runAfter":{"email":["Succeeded"]}},"Create_HTML_table":{"type":"Table","inputs":{"from":"@body('Select')","format":"HTML"},"runAfter":{"Select":["Succeeded"]}}},"runAfter":{}}}

View solution in original post

Never knew you could do this! Very cool! What you have is closer to what I'm after however I don't think I explained my end goal as well so my fault.

 

I ended up following what I found here, and am in good shape.

Solved: Mail merge excluding duplicate emails - Power Platform Community (microsoft.com)

 

Example of final flow:

11.PNG

 

22.PNG

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 (2,998)