To send email to all the users at a time you can check my previous article - Combine values of Multiple Person or Allow Multiple Choice field to send email
But, For schedule flow, If using "Get items" and the list contains "Multiple Person Selection" field and a "Multiple Choice" field and we have to send email for each item separately, then the following steps works perfectly.
I use "Parse JSON" for this flow.
1. We need to Initialize 2 variables for each field. For person field I created "varMultiplePerson" and "varJSONPerson" and for choice field I created "varMultipleChoice" and "varJSONChoice" field.
2. If you have a condition, now set the variables to following fields or values based on requirement. If there is no condition, then set these variables on Intializing step above itself.
varMultiplePerson: The value has to be set to "Multiple Person" field directly. Don't set the field to "Multiple Person Email" or "Multiple Person Display Name" etc.,
varMultipleChoice: The value has to be set to "Choice" field directly. Don't set the field to "Choice item" or "Choice value"
varJSONPerson and varJSONChoice: These both fields will be set to null. Go to "Add Dynamic Content" and go to expression and set it to null.
3. Now save the flow and run it once. When you go to flow history and check the latest flow, you will see the values for varMultiplePerson field and varMultipleChoice variables as below.
Copy the value text and save them to a notepad. You need them when we parseJSON for both fields.
For first "Parse JSON" step content add "varMultiplePerson" and for schema click on "Generate from sample" and add the varMultiplePerson value from step 3
For 2nd "Parse JSON" step content add "varMultipleChoice" and for schema click on "Generate from sample" and add the varMultipleChoice value from step 3
5. Both ParseJSON steps should look like below.
6. Next step is to add "Append to string variable" and select "Email" from JSON Dynamic content for person and select "Value" from JSON Dynamic content for choice fields.7. I choose to add ";" for Email and "," for Choice value fields inside the "Append to string variable". This way while appending the values, they are separated by mentioned symbol above.
8. Add 2 compose steps and assign "varJSONPerson" and "varJSONChoice"
9. Add Compose outputs to the email.
This worked perfectly for me when I need to send scheduled reminder emails for each item separately. Also the "Person field" Allows multiple selections and "Choice field" which I need to mention in the subject is also a "Multi-Selection" choice field.
Please comment below if you face any issues with the above scenario. Also if you have any scenarios that need help, please do comment below.
No comments:
Post a Comment