Email all people in a sub-list
AnsweredHi,
I have a form that allows the entry of a prime contact so that when certain actions are initiated a sharepoint workflow sends an email to the prime contact.
In this form I also have a sublist that contains the names of other people associated with this form. There is only one column in the sublist 'Participant' that is a person / group type of column. On the occasion when I need to email everyone in that sublist, can I do this through the actions in Skybow Rich Forms by looping through the sublist? How would I do this?
I realise that I could just have a column on the primary list that is a person group column that allows multiple entries but then I would need to extract the email address from the first entry in that column and email them for specific events. But not sure how I would do this on the occasion when I need to email everyone in that column.
Grateful for any suggestions
Sandy
-
Hi Sandra Huntley,
you can get those emails by accessing the sublist via the skybow Expression Builder. Use the following code whether in the to, cc or bcc fields of a send email action:
var emails = [];
var getEmail = function(obj)
{
emails.push(obj[0].email);
};
[[@SubLists.Recipients.Recipient]].forEach(getEmail);
return emails.join(';');The sublist needs to be integrated into the form via skybow rich forms to get it available in the context objects.
Thanks Pius Willi for helping me out on JavaScripting
hope this helps!
BR Matthias
0 -
Hi,
When I look at the information stored under a person/group in the primary list I can see that there is an email address available to select, but not on a sublist.
Is this correct?
When I inserted this code and tried to update a column that I stored on the primary list, the instance data couldn't be found. What extra information could I provide that would resolve this issue?
Thanks
Sandy
0 -
This is the error that I receive:
Please advise.......
0 -
Hello Sandra Huntley
Please examine my answer here .
You must use also some FormLoadAction and this script which Matthias prepared together if you want get emails list .
Kind Regards
Andriy Berezovsky0
Please sign in to leave a comment.
Comments
4 comments