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

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

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

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

View solution in original post

Helpful resources

Announcements
firstImage

Better Together Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

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!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (10,166)