03-26-2024 11:38 AM
Hi,
I'm trying to use the action step "Lists by Workato" but I'm having trouble populating the size of the list. I want the size to be a count of all unique "campaign" values. In a previous step in the recipe, a search result has a list datapill result like below (I'm showing just the first three results of many - showing 2 unique campaigns). I was trying to use this formula "(datapill).pluck("Campaign").uniq.length" to determine how many unique "Campaigns" there were as I would like the List to contain a list of unique campaigns. Can you tell me what I'm doing wrong?
{
Entities:
[
{
Campaign: Facebook California
City: Irvine,
},
(
Campaign: Facebook South Carolina,
City: Greenville,
},
(
Campaign: Facebook South Carolina,
City: Greenville,
},
.....
Thanks,
Solved! Go to Solution.
03-26-2024 01:54 PM
You need to hover over it in the recipe data section -- the little mini drawer that appears in the middle/bottom of edit mode.
Basically find the "campaign" data pill (as if you were going to add it to a logger or something) and hover over it to see the API name. (I'm excited to see the API name, haha)
Are you getting an error on the pluck step?
I suggest breaking down the formula down into loggers to see what's happening:
03-26-2024 04:42 PM
Ah, now I see the "API Name"! And it is "Campaign__c". I made the change and followed your troubleshooting suggestions and it works for .pluck, .size and .length. I will use your "breaking down" technique again in the future I'm sure. Thanks once again, again for the help gary1 !
03-26-2024 04:42 PM
Ah, now I see the "API Name"! And it is "Campaign__c". I made the change and followed your troubleshooting suggestions and it works for .pluck, .size and .length. I will use your "breaking down" technique again in the future I'm sure. Thanks once again, again for the help gary1 !
03-26-2024 05:18 PM
Glad it worked out. Gotta love the API name 🤣