Hello Everyone,
I have an App with a SharePoint List at the backend. I have added codes to send emails on Button click which are working perfectly. The code is fetching the email addresses from another Email lists (multiple lists for different roles, e.g. Admin, Read etc). So for example, if i want to send email to Admins then i will fetch the email addresses from the Admin List. Below the Code which is working perfectly fine.
Office365Outlook.SendEmailV2(
Concat(
'Admin List',
Email,
";"
),
"Subject -",
"Message",
)
However instead of managing multiple lists i have created single list with an additional column of roles (List Name: Access Control List). Now I am looking for sending emails if the persons email ID is there in the list and also he is having appropriate role defined. How can i do that please?
Below some details.
Old List Columns as below
List Name: Admin List
Columns: Name, Email
Old List Columns as below
List Name: Access Control List
Columns: Name, Email, Role
Thanks,
Solved! Go to Solution.
Hi @AkshayManke
Since all the data is in one list, you'd need to filter that list based on the role.
To do that, you can make use of the Filter function.
The adjusted formula could look something like that:
Office365Outlook.SendEmailV2(
Concat(
Filter('Admin List', Role = "Admin"),
Email,
";"
),
"Subject -",
"Message",
)
You probably noticed that I added this part:
Filter('Admin List', Role = "Admin")
This makes sure it will only select the list entries where Role equals "Admin". Of course you'd need to adjust "Admin" based on the values you have in the Role column.
I hope this helps.
Kind regards,
Fabian
Please click Accept as Solution if my post answered your question. Like my answer? Consider giving it a Thumbs Up. Others seeking the same answers will be happy you did.
Hi @AkshayManke
Since all the data is in one list, you'd need to filter that list based on the role.
To do that, you can make use of the Filter function.
The adjusted formula could look something like that:
Office365Outlook.SendEmailV2(
Concat(
Filter('Admin List', Role = "Admin"),
Email,
";"
),
"Subject -",
"Message",
)
You probably noticed that I added this part:
Filter('Admin List', Role = "Admin")
This makes sure it will only select the list entries where Role equals "Admin". Of course you'd need to adjust "Admin" based on the values you have in the Role column.
I hope this helps.
Kind regards,
Fabian
Please click Accept as Solution if my post answered your question. Like my answer? Consider giving it a Thumbs Up. Others seeking the same answers will be happy you did.
Hi @FabianAckeret,
Your suggested solution worked perfectly. <Earlier i had the Role Column as Single Line Text hence from administration standpoint i changed it to Choice Type.> So now the formula looks like the below.
Filter('Admin List', Role.Value = "Admin")
Many Thanks for your Help...!
Kind Regards,
Akshay
Stay up tp date on the latest blogs and activities in the community News & Announcements.
Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
User | Count |
---|---|
202 | |
180 | |
62 | |
32 | |
30 |
User | Count |
---|---|
324 | |
268 | |
104 | |
74 | |
56 |