cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dlprentice
Responsive Resident
Responsive Resident

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?

dlprentice
Responsive Resident
Responsive Resident

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":{}}}
dlprentice
Responsive Resident
Responsive Resident

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 Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

New Process Advisor Capabilities carousel.png

Read the blog for the latest news

Read the latest about new experiences and capabilities in the Power Automate product blog.

PA Survey Carousel Image.png

We want to hear from you!

If you are a small business ISV/Reseller, share your thoughts with our research team.

Users online (3,303)