cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
domates
Level: Powered On

For each group by item send email with approval

Hi,

 

we are using a Travel application Form with powerapps and flow and right now for each particpant an email to the supervisor will be send out which means if 5 of his workers are participating he will get 5 emails.

 

To bypass this problem i now did group every participant by his supervisor

ClearCollect(travelerByManager,GroupBy(traveler,"vg","travelerInformation")) and now i need to send each supervisor an email with options for his workes. But i cant use a ForAll method.

Also i i created a flow triggered by powerapps and i now need to send the email with option each supervisor.


Anyone can help my out on this?

2 ACCEPTED SOLUTIONS

Accepted Solutions
RezaDorrani
Level 10

Re: For each group by item send email with approval

Hi @domates 

 

There is a new function in Flow called JSON

 

After ClearCollect(travelerByManager,GroupBy(traveler,"vg","travelerInformation"))

Trigger flow and send the collection as a JSON to Flow

JSON(travelerByManager,JSONFormat.IgnoreUnsupportedTypes)

 

Then in Flow, use json(variablepassed) to get the json value of the collection and traverse through the collection to send your emails for each manager

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

Highlighted
domates
Level: Powered On

Re: For each group by item send email with approval

Hi thank you for helping me out, i tried to parse the json to only give me the "vg" items which contains the supervisor's, but couldn't figure it out. Any idea how to do that?

 

[  
   {  
      "travelerInformation":[  
         {  
            "assignment":"asf",
            "checkup":null,
            "costlocation":"fdasfd",
            "deputy":null,
            "emplid":"asdfas",
            "participant":{  
            .....
            },
            "titel":"TA10333"
         }
      ],
      "vg":"blabla@blabla.com"
   },
   {  
      "travelerInformation":[  
         {  
            "assignment":"asdf",
            "checkup":null,
            "costlocation":"asfsaf",
            "deputy":null,
            "emplid":"sdf",
            "participant":{  
             ....
            },
            "titel":"TA10333"
         }
      ],
      "vg":"blabla@blabla.com"
   }
]
2 REPLIES 2
RezaDorrani
Level 10

Re: For each group by item send email with approval

Hi @domates 

 

There is a new function in Flow called JSON

 

After ClearCollect(travelerByManager,GroupBy(traveler,"vg","travelerInformation"))

Trigger flow and send the collection as a JSON to Flow

JSON(travelerByManager,JSONFormat.IgnoreUnsupportedTypes)

 

Then in Flow, use json(variablepassed) to get the json value of the collection and traverse through the collection to send your emails for each manager

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

Highlighted
domates
Level: Powered On

Re: For each group by item send email with approval

Hi thank you for helping me out, i tried to parse the json to only give me the "vg" items which contains the supervisor's, but couldn't figure it out. Any idea how to do that?

 

[  
   {  
      "travelerInformation":[  
         {  
            "assignment":"asf",
            "checkup":null,
            "costlocation":"fdasfd",
            "deputy":null,
            "emplid":"asdfas",
            "participant":{  
            .....
            },
            "titel":"TA10333"
         }
      ],
      "vg":"blabla@blabla.com"
   },
   {  
      "travelerInformation":[  
         {  
            "assignment":"asdf",
            "checkup":null,
            "costlocation":"asfsaf",
            "deputy":null,
            "emplid":"sdf",
            "participant":{  
             ....
            },
            "titel":"TA10333"
         }
      ],
      "vg":"blabla@blabla.com"
   }
]

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 46 members 4,820 guests
Please welcome our newest community members: