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

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
Super User

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
Super User

Do you mean System and Acronym?

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

Paulie78
Super User
Super User

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
Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Top Solution Authors
Top Kudoed Authors
Users online (1,477)