Sub-list Person Group Issue
AnsweredHi,
I have a form that I have created for a list that has an associated sub-list. When I look at my person / group column in the primary list I can select their email, however, when I look at the person / group column in the sub-list I cannot see the email as an option.
Example:
Newsletter with Subscribers.
Newsletter list has an editor person/group column and when I want to execute a script I get the following options listed under it:
OriginalValue
isChanged
CurrentValue
Title
LoginName
The Subscription list has a subscriber person / group column and when I want to execute a script I get the following options listed under it:
Sum
Average
Count
Min
Max
How can I get the same options for my subscriber as I do for my editor?
I am on Rich Forms 3.1.0.2 on O365.
Sandy
-
Hello @Sandra Huntley,
Thank you for the question with a great example.
You can't get the same list of options of person/group column on a sub-list, because here you have not one item(subscriber), but a list of items(subscribers), which are related to you main list item(editor). So that's why you have aggregated options in the column of sub-list.
What do you like to do with emails?
Maybe you need to have a list of emails of the subscribers which are related to some editor. This can be achieved in another way using Rich Forms app.
Best Regards,
Oleg Kachmar
0 -
Hi Oleg,
Because all I needed were the names and email addresses of the subscribers, I have created a column in my Newsletter list of a person/group type allowing multiple entries to get around this problem.
How would I validate that I didn't get any duplicates in that column, validating on email address? I also need to ensure that the editor is not included in that list either?
Thanks
Sandy
0 -
Hello Sandra Huntley
We prepared solution for you . Using this script you can retrieve from sublist all user email addresses without duplicates and then for example send emails on that addresses.
Step 1: Add FormLoadAction type execute scipt on your form where you added a sublist with the following script:
var oldNormalize = window["Ardevia"].RichForms.Render.DisplayFormFieldElements.SubListValuesProvider.NormalizeValue;
window["Ardevia"].RichForms.Render.DisplayFormFieldElements.SubListValuesProvider.NormalizeValue = function (fieldSchema, val) {
var normalizedValue;
if(fieldSchema.FieldType == "User"){
if(val){
val.toString = function(){return val.localized;};
val.toLocaleString = function(){return val.localized;};
}
normalizedValue = val;
}else{
normalizedValue = oldNormalize(fieldSchema, val);
}
return normalizedValue;
};Step 2: Then you can retrieve that emails addresses from sublist using next code:
( for example you want send letter to that email addresses so you must create send email action and past next code into "To" field . Code will return string with emails in format : "email1;email2;")
var emails = [];
var getEmail = function(obj){
emails.push(obj["data"].email);
};
[[@SubLists.YOUR_SUBLIST_NAME.SUBLIST_FIELDNAME]].forEach(getEmail);
var emailsList = emails.join(';');
return emailsList;Hope this will help you.
Kind Regards
Andriy Berezovsky0
Please sign in to leave a comment.
Comments
3 comments