How do you use WSProxy in SSJS to Retrieve, Create, Update, Delete, and Upsert records?
Suggested answer
WSProxy is a SSJS library that wraps the SOAP API. Example patterns:
Retrieve: var prox = new Script.Util.WSProxy(); var cols = ["Name","CustomerKey"]; var response = prox.retrieve("DataExtension", cols);
Create: prox.createItem("DataExtensionObject", {CustomerKey:"DE_Key", Properties:[{Name:"Email",Value:"test@x.com"}]});
Update: prox.updateItem("DataExtensionObject", {CustomerKey:"DE_Key", Properties:[...]});
Delete: prox.deleteItem("DataExtensionObject", {CustomerKey:"DE_Key", Properties:[{Name:"SubscriberKey",Value:"123"}]});
Upsert: prox.upsertItem("DataExtensionObject", {...});
WSProxy handles authentication automatically using the context token, avoiding manual OAuth flows in Script Activities.
Practice content for interview preparation; not an official vendor answer. Verify details against current product documentation.
Community comments (0)
No comments yet.
Sign in or create a free account to add a comment. Comments are moderated before they appear.