Remove a recipient from a list from a list from workflow

Avatar

Avatar
Validate 1
Level 1
SorenDahk
Level 1

Likes

0 likes

Total Posts

8 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
SorenDahk
Level 1

Likes

0 likes

Total Posts

8 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile
SorenDahk
Level 1

11-05-2021

Hi there! I have a project ongoing where I am adding leads to a list of recipients. I want to automatically remove recipients from the list when a lead converts to a paying customer. 

I can not figure out how to achieve that. Any pointers to how this can be done through a workflow?

View Entire Topic

Avatar

Avatar
Shape 1
Level 4
CedricRey
Level 4

Likes

38 likes

Total Posts

78 posts

Correct reply

19 solutions
Top badges earned
Shape 1
Boost 25
Applaud 5
Affirm 5
Give Back 3
View profile

Avatar
Shape 1
Level 4
CedricRey
Level 4

Likes

38 likes

Total Posts

78 posts

Correct reply

19 solutions
Top badges earned
Shape 1
Boost 25
Applaud 5
Affirm 5
Give Back 3
View profile
CedricRey
Level 4

12-05-2021

Hello SorenDahk,

 

You can try to use the "Unregister" method of nmsGroup object with a JS.
As it is not a static function, you have to load your list and then remove your element with a query (this is not well documented in the JSAPI, I had to do some test) :

var listId = listId; //You have to know your list ID
var recipientId = recipientId //You have to know your recipient (or what you want to delete from list) ID
var myList = NLWS.nmsGroup.load(listId); //Load the list
myList.Unregister( 
    <listChoice selectAll="false"><key value={recipientId}/><where><condition expr={"@id = " + recipientId}/></where></listChoice>
     );//Remove the element from the list (beware, the identifier here is the @ID attribute, but it can be another attribute 😉 )

Hope this could help.

Cedric