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
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Users online (20,933)