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

Send an email to users that has rights on different and specific elements

Hi,

Hope somebody can help me.

i have a table into an excel formatted like this: (this is an example)

 

Spoiler

User   |  Elements List  |     AdminUser       | e-mail column
--------------------------------------------------------------------

Axel         Element 1        AdminUser 1      email AdminUser 1

Axel         Element 2        AdminUser 1      email AdminUser 1
Axel         Element 3        AdminUser 1      email AdminUser 1
Bob          Element 4       AdminUser 2       email AdminUser 2

Bob          Element 5       AdminUser 2       email AdminUser 2
Bob          Element 6       AdminUser 2       email AdminUser 2
Frank        Element 7      AdminUser 3       email AdminUser 3

 

I'm trying to setup a Flow that send email to a specific AdminUser,

The body of this email has to contain the name of an User and the Elements List which User has some rights on it.

 

Example:

Axel has rights to see Element1, Element2, Element3

AdminUser 1 has to be notified about that and has to receive one email with body like this:

 

Spoiler

Hello, this is to remind that Axel has rights on:

  • Element1
  • Element2
  • Element3

Please check

Obviously each time the Flow runs and find different AdminUser email it needs to send different mails to different receiver with the same format as the example given.

 

Problems:

  • I can't manage to send ONE email, i don't want 3 emails because Axel has rights on 3 elements.
    Using Apply to Each i'll end up receiving 3 emails in the AdminUser 1 mailbox.

Goal:

  • One email with all the elements listed for that specific User only.

Hope that i clarified my need.

Thank you in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Send an email to users that has rights on different and specific elements

Hi @En1gma 

 

I did some more resarch on pulling out records by grouping a common ID and I found that there is a thread on similar lines. You can follow the solution mentioned here :

https://powerusers.microsoft.com/t5/Building-Flows/Group-multiple-Excel-rows-into-an-HTML-table/td-p...

to get the values with Dynamic IDs and then use the flow I showed you to iterate for each User and send email to them. 

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

7 REPLIES 7
Super User
Super User

Re: Send an email to users that has rights on different and specific elements

Hi @En1gma 

 

Please refer to the screenshot below:

 

exceTy.png

 

exceTy2.png

You can use the filter action in the List Rows action and get the records corresponding to a particular user. Later you can use an apply to each to append each row value to an array and finally send the email by joining the items of the array with the empty line string. Please check the variables and replicate accordingly. 

 

Here, Description is a column in my excel and replace it with the element of yours. Column 5 is email address and you can replace that with the email column of your excel sheet. In the List rows action, you can see the filter query User eq Alex. If you have multiple users, put them all in an array and create another loop to list the rows accordingly. 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

En1gma
Level: Powered On

Re: Send an email to users that has rights on different and specific elements

Thank you @yashag2255 i've appreciated you quick reply

I've set up the Flow as you suggested and actually it works perfectly if i need to send the email to a specific single user.

 

What i need now is e.g:

User   |        Elements       |      Email      |

-------------------------------------------

Axel                   1                   emailX

Axel                   2                   emailX

Axel                   3                   emailX

Robert               4                   emailY

 

Running the Flow the output should be:

 

 

Spoiler

Send email to: emailX

Hi, this is to remind that Axel has rights on 1,2,3

 

Send email to: emailY

Hi, this is to remind that Robert has rights on 4

the problem i see is the filtering, how can i manage to filter each time by user?

 

Thank you very much for your help.

 

 

Super User
Super User

Re: Send an email to users that has rights on different and specific elements

Hey @En1gma 

 

If you have multiple users, put them all in an array and create another loop to list the rows accordingly. " How many users o you have? Is it fixed? Can we have a list of users that are there in the excel sheet? if so, we initialise an array variable and put all the users in that array and create a apply to each loop and add all the consequent actions from the flow to the apply to each action and in the filter query of list rows, replace the word"Alex" with the current item of the apply to each. 

 

Hope this Helps!

Highlighted
En1gma
Level: Powered On

Re: Send an email to users that has rights on different and specific elements

Hi @yashag2255,

The users number is not fixed and it will variate over time, we'll update the sheet accordingly.

 

This is the actual of my sheet:

 

 

Spoiler

User      |       Servers           |     Email

--------------------------------------------

Axel                     1                  emailX 

Axel                     2                  emailX

Robert                 3                  emailY

Robert                 4                  emailY

 

 

initialize section:

Initialize.PNG

 

List rows and array population

2.PNG

 

List Rows in apply to each with filter with current item.

3.PNG

 

Is this correct?

 

Now we need to send the email for each user with the related Servers list.

 

Thanks for your help.

Super User
Super User

Re: Send an email to users that has rights on different and specific elements

Hey @En1gma 

 

This will not work. As you are having the list of admin names where there are enteries mroe than 1 (Alex has 3-4 machines and his/ her name appears 3-4 times) and this flow will iterate for each and every Alex and send an email so many number of times. 

Super User
Super User

Re: Send an email to users that has rights on different and specific elements

Hi @En1gma 

 

I did some more resarch on pulling out records by grouping a common ID and I found that there is a thread on similar lines. You can follow the solution mentioned here :

https://powerusers.microsoft.com/t5/Building-Flows/Group-multiple-Excel-rows-into-an-HTML-table/td-p...

to get the values with Dynamic IDs and then use the flow I showed you to iterate for each User and send email to them. 

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

En1gma
Level: Powered On

Re: Send an email to users that has rights on different and specific elements

Thank you @yashag2255 

I've done it! with links you provided i've came up with a solution that fits our needs.

 

Best regards,

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: 208 members 4,009 guests
Please welcome our newest community members: