Remove a recipient from a list from a list from workflow | Community
Skip to main content
Level 4
May 11, 2021
Solved

Remove a recipient from a list from a list from workflow

  • May 11, 2021
  • 2 replies
  • 3036 views

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?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Jonathon_wodnicki

Hi,

 

Use the recipient list feature of the software.

The 'List update' workflow activity only allows for [over]writing lists so use the 'Update data' activity for deletion:

  1. Scheduler or signal activity
  2. Query for recipients that became leads since the workflow last ran
  3. Delete them from nms:rcpGrpRel

 

Thanks,

-Jon

2 replies

Jonathon_wodnicki
Community Advisor
Jonathon_wodnickiCommunity AdvisorAccepted solution
Community Advisor
May 11, 2021

Hi,

 

Use the recipient list feature of the software.

The 'List update' workflow activity only allows for [over]writing lists so use the 'Update data' activity for deletion:

  1. Scheduler or signal activity
  2. Query for recipients that became leads since the workflow last ran
  3. Delete them from nms:rcpGrpRel

 

Thanks,

-Jon

SorenDPAuthor
Level 4
May 12, 2021
Hi Wodnicki. Thanks for the proposed solution, this is very helpful!
CedricRey
Level 5
May 12, 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 @1716897 attribute, but it can be another attribute 😉 )

Hope this could help.

Cedric

ALangridge
Level 4
June 7, 2022

Incredibly useful post! I can't believe this isn't outlined in official documentation anywhere.

I just used this as the basis of a script to iterate rows and remove from a given list, which has massively streamlined a business process.