
Hello everyone,
I have a SharePoint list called "Profils2" with two colulmns : "Personne" (which contains diffrerent users) and "Statut" (which is a choice selection between "Admin", "Contributeur", "Informé" and "Participant").
From this list, I've built a gallery that displays the users and their status underneeth.
Now I would like to know how to add a dropdown box to filter on the "Statut" of users.
Then, I would like to add one checkboxe next to each user and one "Select All" checkbox next to the filter dropdown that would select all the visible users in the gallery (so it has to take into account the filter).
Finally, after selecting the correct users, their emails would get stored somewhere and with a click of a button it would send them an email.
Thanks,
Max
Hi @Anonymous ,
Based on what you have explained , I believe that you want to send emails to the users who will be displayed in the gallery ,(the entries of which are filtered based on the dropdown you have added).
You can create a collection using the gallery ,
For eg. If Gallery1 is your gallery name then, your code should be as below.
ClearCollect(colUsers,Gallery1.AllItems)
Again if you want to filter the colUsers based on some value you can do that(For eg. checkbox selected values).
Now , you can use a ForAll function to loop through the collection in colUsers and use a SendEmailV2 action to send an individual email to each user. The below code would help you achieve that.
Here you should add the Office365Outlook connector from add data section.
ForAll(
colUsers,
Office365Outlook.SendEmailV2(
ThisRecord.Email,
"This is the Email Subject",
"This is the Email Body"
)
)
If you want to send a single email to all users , then you should Use the code as below,
ClearCollect(
colAllUsersEmail,
ForAll(
colUsers,
Concat(
colUsers,
ThisRecord.Email,";"
)
)
)
//Here Assuming that Email is the column in your collection colUsers
Now , in the Send Email V2 action in place of ThisRecord.Email , you should use , First(colAllUsersEmail) , and that should be fine.
If this helps , please give this answer a thumbs up and accept this answer as a solution.
Thanks,
Sanmesh