InvokeRetrieve
→ object[]Executes a SOAP Retrieve operation to retrieve SFMC objects. Typically used with CreateObject and filter configuration.
Available in:
Email
CloudPage
Automation
Triggered Send
Syntax
Platform.Function.InvokeRetrieve(apiObject, status)
2 arguments
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
apiObject |
object | Yes | Configured Retrieve request object |
status |
array | Yes | Array that receives the status and request ID of the API call (e.g. [0, 0]) |
Examples
var RetrieveRequest = Platform.Function.CreateObject("RetrieveRequest");
Platform.Function.SetObjectProperty(RetrieveRequest, "ObjectType", "Email");
Platform.Function.AddObjectArrayItem(RetrieveRequest, "Properties", "Email.Name");
var filter = Platform.Function.CreateObject("SimpleFilterPart");
Platform.Function.SetObjectProperty(filter, "Property", "Status");
Platform.Function.SetObjectProperty(filter, "SimpleOperator", "equals");
Platform.Function.SetObjectProperty(filter, "Value", "Active");
Platform.Function.SetObjectProperty(RetrieveRequest, "Filter", filter);
var StatusAndRequestID = [0, 0];
var Emails = Platform.Function.InvokeRetrieve(RetrieveRequest, StatusAndRequestID);
WSProxy.retrieve() is simpler and preferred for new code.