Marketing Automation, Salesforce Marketing Cloud, SFMC Tips & Tricks

WS proxy retrieve filter value limitations

WS proxy retrieve filter value limitations

I have discovered that when using the WS Proxy Retrieve method in Salesforce Marketing Cloud, the Filter’s Value property has limitations. Let’s find out how we can mitigate them.

After dedicating a couple of hours to debugging, I found that half of the records are lost and never queried from the database using the WS Proxy Retrieve method. If you provide an array, as seen below, into the filter value, it will only take the first 5 records of the array, and the rest will be ignored. In my case, it was five automation CustomerKeys. However, when querying automations by statuses and providing a numeric array of statuses with a length of 10, all of them are taken into the filtering condition. So, it cannot be taking only the first five array items; there might be some character length restrictions that I have never encountered before.

Salesforce Marketing Cloud - automation customer keys array

What exactly is the limitation when using the WS Proxy Retrieve method in Salesforce Marketing Cloud SSJS? Let’s apply simple logic to figure out where I encounter record cuts. After several attempts, it appears that I can only retrieve a maximum of 5 automations by their customer key. Given that one customer key is 37 characters long, I printed an array of 5 customer keys using Write and Stringify to examine the total character length of such a stringified array. Lo and behold, my fancy Visual Studio for code showed me that my array gets cut after 200 characters.

How to mitagate it?

Now that I know what I’am fighting against I can apply simple fix to mitagate it. I loop my original array of 300 customer keys and split the ws proxy retrieve to only take five customers keys at the time. These I keep pushing to my final array of all automation objects.

var automations = ["91f649a9-475e-6979-8732-1b02b48ad76d","a426504b-ce0e-ce8f-135b-4867b25a3e51",...., 300 more], 
	filter={};
for(k = 0;k < automations.length;k += 5){
//fetch automations fith retrieve method
//filter should look like
   filter = {
     Property: "CustomerKey",
     SimpleOperator: "IN",
     Value: automations.slice(k, k + 5)
   };
//retrieve using ws proxy and fetch all the data
//loop Results from ws proxy and push to your final array
  finalArray.push(data.Results[i])
}

You can see the example of advanced retrieves via ws proxy in the official documentation.

Oh hi there 👋
I have a FREE e-book for you.

Sign up now to get an in-depth analysis of Adobe and Salesforce Marketing Clouds!

We don’t spam! Read our privacy policy for more info.

#cloud page #JavaScript #programming #ssjs
Marcel Szimonisz
Marcel Szimonisz
MarTech consultant As a marketing automation consultant, I specialize in problem-solving, process automation, and driving innovation for clients' marketing platforms.

I hold certifications in Adobe Campaign v6 (3x certified) and Salesforce Marketing Cloud (5x certified), as well as 1x Salesforce Associate certified.

Moreover, I serve as a community advisor for Adobe Campaign, providing expert insights and guidance.

Beyond my professional pursuits, I explore various programming languages, CMSs, and frameworks, enhancing my technical expertise and staying at the forefront of industry advancements.
Take a look at our subscription offering in case you are looking for a Marketing Automation Consultant.

Similar posts that you may find useful

How to use sysFilters in data schemas
Adobe Campaign, Marketing Automation

How to use sysFilters in data schemas

2 minutes read

When you run multiple business units on a single Adobe Campaign Classic application, it is beneficial to restrict operators from accessing other business units’ data. We all know that restricting data on form views and with folder access restrictions may not always be successful. The only bulletproof method of managing write or read access rights […]

Continue reading
Exploring the Dynamic World of Email Marketing: Diverse Template Designs in Salesforce Marketing Cloud
Salesforce Marketing Cloud, SFMC Tips & Tricks

Proof multiple template variants in SFMC

2 minutes read

When working with dynamic email templates that can generate multiple unique variants of the email, you are most probably tasked to proof all the variants to your stakeholder for review. Create data extension When proofing email templates, traditionally, we select subscribers from production or testing data extensions used in the actual send. This process involves […]

Continue reading
Adobe Campaign on Debian linux
Adobe Campaign, Marketing Automation

Install Adobe Campaign Classic on Debian

15 minutes read

Psst! Listen up, fellow campaigners! Did you know that you can actually install Adobe Campaign Classic locally and it won’t cost you a penny? Of course, you won’t be able to run actual marketing campaigns with it, but you can use it as your personal development playground. It’s like having a sandbox, but for grown-ups. […]

Continue reading
SFMC tips and tricks
Marketing Automation, Salesforce Marketing Cloud, SFMC Tips & Tricks

Google Analytics Integration: broken links

less than a minute read

When you integrate with Google Analytics, marketing cloud will add tags to all your links. When this happens, all dynamic links will be broken. Links that are defined programmatically as variable, field or attribute with GA integrated will look as if the tracking link also appends google analytics tags. This will make such link not […]

Continue reading
Salesforce Marketing Cloud Tips
Marketing Automation, Salesforce Marketing Cloud, SFMC Tips & Tricks

How to utilize polyfill functions in SFMC

1 minute read

Development in Salesforce Marketing Cloud’s SSJS can be very restrictive, especially when you’re already familiar with the latest EcmaScript6 JavaScript features. We can’t use object spreading or curly bracket functions {}=>() and many, many more. However, we can introduce certain very helpful functions that don’t exist in older versions of JavaScript. The way we do […]

Continue reading