Hi guys,
I'm trying to update some already created lists dynamically.
Anyone has a js code to implement this activity?
The idea is to save the recipient list in these groups via an unique ID, so I guess I've to run a for...each but I have no idea on how to read and write via js
thanks
Solved! Go to Solution.
Views
Replies
Total Likes
Hi Maurizio,
If your need is to achieve this treatment in a workflow, I rather recommend you to use the OOTB "List update" activity.
Please see documentation:
How to use workflow data
Targeting activities
If you still need Javascript code to do the same for another reason, you can use the JSAPI nms.recipient.RegisterGroup function.
Please refer to the JSAPI.chm documentation (restricted to license) for details.
Regards
J-Serge
Views
Replies
Total Likes
Hi Maurizio,
If your need is to achieve this treatment in a workflow, I rather recommend you to use the OOTB "List update" activity.
Please see documentation:
How to use workflow data
Targeting activities
If you still need Javascript code to do the same for another reason, you can use the JSAPI nms.recipient.RegisterGroup function.
Please refer to the JSAPI.chm documentation (restricted to license) for details.
Regards
J-Serge
Views
Replies
Total Likes
Thanks,
I've tried with the OOTB but I was unable to set the group name dynamically. I'll have a look to the documentation JSAPI
Views
Replies
Total Likes
Hi Maurizio,
Please select the 2nd radio button then you can put your variables for the list name:
Regards
JS
Hi Jean-Serge
thanks, now my issue is how to populate the instance.vars
In my WF I've loaded an external FTP file with account_id and list_ids and with list update I've to store the recipients in the proper list. So I need to match the list_ids from the external file, with the actual ids of the already created lists.
My question is: how to put the id field in the instance.vars?
thanks
Views
Replies
Total Likes
Please may you describe the file structure in details and tell if you can have other structure. Depending on the file structure, the treatment is different.
For instance, if the structure is:
account_id list_ids
recipient1 list1,list2,list3
recipient2 list1,list5
the solution is probably to do it in JS with a foreach loop and splitting list_ids in a JS array with split function then call the nms.recipient.RegisterGroup
The List update activity is intended to update one List (group in case of recipient) at a time. And doing a standard loop in the workflow is not convenient. The List update is useful for mass-update (as in SQL).
But perhaps someone else could suggest another approach for doing a mass-update with such file structure.
If you have many files, each file regarding a list, the file containing the recipient id list, then I consider than using Collector files and loop for List update activity is more adapted.
Well, hope this could help.
Regards
JS
Views
Replies
Total Likes
Hi,
that's exactly my initial structure, however after an enrichment and a deduplication activity now that's what I got:
userId, list name, list id
maybe I can now use the UpdateList activity but, again, I don't know how to get the proper name.
That's the schema:
So I need to put 8000037 user in the list called Mobile Phones_SA, etc.
How to get the "Mobile Phones_SA" name via the instance.vars?
I know it's a dumb question, but it's my first time...
in the meanwhile I'm trying to reach the scope via a for each: I successful listed the data, now all I need is the js code to update dynamically the lists...
Views
Replies
Total Likes
so you can manage your goal by using the Update activity directly, with this enriched targetData result set
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies