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

flow to run once for all the items assigned to that manager

Hello Everyone,

 

I am trying to find right solution from couple of weeks and no luck in findind it.

 

 

scenario: There are several items in a list and asigned to several different managers. However, each manager might be assigned with more than 3 or 4 and so on. What my flow should do is that on a specific date it should trigger an email for assigned to manager, but if manager has multiple line items then it should trigger only once instead of sending email for each and every line item. I would like to reduce email flood for the manager if there more than 50items assigned to him. 

11 REPLIES 11
Super User
Super User

Re: flow to run once for all the items assigned to that manager

@rajkumar88 

Hi there!  Totally possible with a recurrence trigger.  I think one option might be to build a little html table for each manager and include that in the body of the email.  There is a SELECT function also, but I don't know if that lets you do a GROUP BY.

Either way:

  • How many managers are we dealing with?  Is it a static list or does it change (if so, how frequently)?  (Do you keep a list of managers someplace else?)
  • Where is the list currently? Sharepoint? 

Keep us posted.

-Ed-

 

 

If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

rajkumar88
Level: Powered On

Re: flow to run once for all the items assigned to that manager

Hi,
The list is currently in sharePoint and each item is saved based up on the user submits his/her request through powerapps. And also while saving the item powerapps will automatically retrieves the user.manager details and it will save it to assigned to column.

Now flow has to send emails on soecific date using recurrence for the line items based up assigned to, however it should send only once
Highlighted
Community Support Team
Community Support Team

Re: flow to run once for all the items assigned to that manager

Hi @rajkumar88 ,

 

Do you want to send the all items responsible for each manager to them in an email?

Please refer to the following method to configure your Flow. For testing, I created a Person field (not allow multiple selections).

 

  1. Create two variables to store Assigned To email and Html table content respectively.
  2. Configure Get items to get all Assigned To email.
  3. Use union() function to remove duplicate emails and traverse this array.
  4. Determines whether Assigned to Email is equal to the current item. If they are equal, append information about the item to the variable.
  5. Configure the HTML table and send the email to the current email. Note that we need to set Is html field to Yes.
  6. Finally, we need to empty the array.

Image reference:

27.PNG28.PNG29.PNG

Hope it helps.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
rajkumar88
Level: Powered On

Re: flow to run once for all the items assigned to that manager

hi @v-bacao-msft ,

 

Just to confirm again, from the screen shot I can is a filed called "assigned to email" . So is this a single line of text you have created in sharepoint list or "person or group" filed type ?

 

Because my assignedto is an person or group filed with allow multiple selections. the reason I did that is that Powerapps will retrieve user.manager details and it will save it to "assognedto" column directly during the "submit form" .

Community Support Team
Community Support Team

Re: flow to run once for all the items assigned to that manager

Hi @rajkumar88 ,

 

Assigned To is person field and not allow mutiple selection.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
rajkumar88
Level: Powered On

Re: flow to run once for all the items assigned to that manager

Hi @v-bacao-msft ,

 

Thanks for confirming. But my PowerApps "save" button requires to pull the user.manager details and save it to that "Manager" person column which requires "allow multiple selection". This solution was propose by one of the community meember. So now Flow needs to have different way. can you please help me out on how to fix this scenario? 

 

Instead of using PowerApps to pull user manager etails. Do you want me to add an extra step before all of your steps to get each submitted item "createby" user manager details and save it to "Manager" person column? 

 

Sorry I am bit confused here

rajkumar88
Level: Powered On

Re: flow to run once for all the items assigned to that manager

@v-bacao-msft,

 

you have metioned that ine mail body, need to to use "output" from HTML tabel. But can I add custom email isntal of the output? In the email I would liek to only add regualr text as Hi, please clck on below link" .

Community Support Team
Community Support Team

Re: flow to run once for all the items assigned to that manager

Hi @rajkumar88 ,

 

If you can, try setting the Assigned To field to not allow multiple selection, then use the method I provided to configure Flow.

I think User and Manager seem to be a many-to-one relationship, so the Assigned To field seems to support only single selection.

 

If you don't need html table, you could make some changes based on the methods I provided earlier.

  • Replace the type of variable 2 with a String and name it Link to item.

6.PNG

  • Change Append to array variable 2 to Append to string variable and fill in the following.

7.PNG

  • Configure custom content and String variables in the email body.

8.PNG

  • Finally, you still need to clear the value of variable 2.

9.PNG

 

Please take a try.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
rajkumar88
Level: Powered On

Re: flow to run once for all the items assigned to that manager

@v-bacao-msft ,

 

Thanks for your sugegstion. I made column as "not to allow multiple selections". I will make changes as per your comments. As of now I am not allowing any suer to access SharePoint list. Instead I am providing filters on the form itself where they can see pending and submitted requests and can edit as required. So I believe I can add PowerApps URL in the"append to string" variable or all of that can also be ignored and I can add "PowerApps link directly in the email body right" ? 

Community Support Team
Community Support Team

Re: flow to run once for all the items assigned to that manager

Hi @rajkumar88 ,

 

I am afraid I did not understand what you mean.

Could  you share screenshots of the current Flow configuration and use screenshots to illustrate your needs?

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
rajkumar88
Level: Powered On

Re: flow to run once for all the items assigned to that manager

@v-bacao-msft,

 

Instead of using your second variable suggestion to capture link to item, can I just use "HTML" output tabel by making sure only "Manager" display name is included?

 

And then in the email body, I want to use my own text along with the HTML table output with Manager disaply name? Is this possible?

 

Below screen shot I want to ignore as all the Managers will have a link available already and they can see what are pending and assigned to them on powerApps itself. Capture.JPG

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

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 Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (6,059)