Navigate:
If you’re reading this, you’re aware that Campaign’s official documentation can be a bit sparse on details sometimes.
I’ve run into a very egregious example of this in the .Register() function for lists HERE
”takes XML recipientList” - wonderful, how helpful.
After an utter ton of fumbling around, I was able to get it to work with the following:
var listId = 11122223333 (obviously just get your list primary key) var recipientId = 12345678 (get your recipient Id from whereever) var listObj = NLWS.nmsGroup.load(listId); listObj.Register( <recipientList> <data> <recipient id={recipientId}> </recipient> </data> </recipientList> )
With custom fields - for example, a “registration date” field that records a timestamp, I was able to get this working with the following format:
var listId = 11122223333 (obviously just get your list primary key) var recipientId = 12345678 (get your recipient Id from whereever) var now = formatDate(getCurrentDate(),"%4Y/%2M/%2D %02H:%02N:%02S") var listObj = NLWS.nmsGroup.load(listId); listObj.Register( <recipientList> <data> <recipient id={recipientId}> <registerDate>{now}</registerDate> </recipient> </data> </recipientList> )
The <registerDate> name can be acquired from looking at the XML source of the target
![notion image](https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2Fca97ec3c-17a5-461e-a086-5d87f0ba3c81%2F84ce4901-2db2-4664-865b-841a7bbbb03c%2FUntitled.png?table=block&id=f16efc9d-2ba6-4e34-8d79-e1e446b3903b&cache=v2)
![notion image](https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2Fca97ec3c-17a5-461e-a086-5d87f0ba3c81%2F23ef2846-a3e3-4317-98c3-3bef360c05aa%2FUntitled.png?table=block&id=f672cef2-640a-411a-add3-11ecc009b2d0&cache=v2)