Add/Update All Subscribers from Data Extension via SSJS
Updated: Sep 15, 2019
Sometimes adding/updating the subscriber status either in real time scenario or testing can be a pain.
With help of below code snippet of SSJS, you can add/update subscribers from Data extension.
Create a data extension. In the above example the data extension name is 'Test_AddSubscribers'
'IsSubscriber' is one of the column in data extension where it shows the subscriber has been added for new subscriber and updated for existing subscribers.
For demo purpose, I have kept subscriber key as email address, Change the Line No - 27 for changing the subscriber key to be added in all subscriber list.
Below is the properties for the data extension:
If the email address is not present in all subscriber list it will add it in All - subscriber list and will update the data extension row as 'ok added'.
If the email address have matched then it will update the All subscriber list and will update the data extension row as 'ok updated'.
Please feel free leave your comments in case of any queries.