Hi Alex, I read the post Use a User Group in Email and was wondering how to modify this so that I can get multiple groups into an email. I have a field where I am appending a different set of user groups depending on the selection of a multi choice field. I wasn’t sure how to pull those dynamic groups using the getFieldValue into your code below:
var ugr = spjs.dffs.getUserCollectionFromGroup(“GroupA”);
var emails = ;
var useThisInToField = emails.join(“;”);
Are you setting the groups in a people picker, or in another field?
If you get the user group names from a people picker you can query the users from multiple groups like this:
var emails = , groups = getFieldValue("NameOfYourPeoplePickerField");
var ugr = spjs.dffs.getUserCollectionFromGroup(g);
var useThisInToField = emails.join(";");
Replace “NameOfYourPeoplePickerField” with your field name.