โ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 11:46 AM
Pluck is case sensitive, so hover over the data pill to see the "API name" to ensure you're using the right value in the formula.
I bet it's "campaign". Drives me nuts.
โ03-26-2024 01:24 PM
Hi gary1 once again. I tried "campaign" and "Campaign" with no luck. Here is the actual data from the datapill that I am trying to use. I don't see anything labeled "API name".
โ03-26-2024 01:27 PM
Here's some more information:
โ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: