cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

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

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

 

View solution in original post

Highlighted
Helper I
Helper I

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"
   }
]

View solution in original post

2 REPLIES 2
Highlighted
Dual Super User
Dual Super User

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

 

View solution in original post

Highlighted
Helper I
Helper I

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"
   }
]

View solution in original post

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

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

Top Solution Authors
Top Kudoed Authors
Users online (6,063)