Last active
November 15, 2022 18:03
-
-
Save katydorjee/41104f1bc57060a3589d0853bc55cd01 to your computer and use it in GitHub Desktop.
Update Marketing Cloud All Subscribers using SSJS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script runat="server"> | |
Platform.Load("core", "1.1.1"); | |
var subscriber = { | |
SubscriberKey: "S_10001", | |
"Attributes": { | |
'First Name': "Karmab", | |
"Last Name": "Dorjeeb" | |
}, | |
"Lists": {"ID": 101} | |
}; | |
try { | |
var subObj = Subscriber.Init("SubKey"); | |
var status = subObj.Update(subscriber); | |
Write("Response: " + Stringify(status)); | |
} catch (ex) { | |
Write("catch: " + Stringify(ex)); | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment