Skip to main content

Hi all, this is Erin Oz from the Zapier Premier Support Team with a tip for creating custom “pills” to map fields in Zapier. 

Background Info

Some apps have a hard-coded sample that is retrieved when creating a new trigger. In apps that allow custom fields, this can lead to a situation where the custom fields you’d like to use later in the Zap’s action steps are not shown in the sample. 

This often leads to placeholder errors, because the field sent in a live call is different than the field mapped from the sample. 

Example

For example, let’s say your trigger pulls in a default sample that shows an Address field:

-XvT8ae3WEqMd6LCgp_6nA7Jyn5JMGz-vAj68-fNBgMQsDQ5K_LQ0AkJdXl2ITZd0PomEmafhagBOR6XrIMPpuQDsZ65Al0SRb7hoMzL9FBzMrGYEBV-B4VF5i1QTIbaFba6V7gW

(view larger)

You build your Zap, and you map the Address to the destination field in your action step. 

GObInFtLq9Na53gjDSplQkvhwVf8nVF1TTpjAxjB_0g3BaY7yjwLooPBwBrIMrzjnO8MXFiTIIhS53oIFpLC7BNCJ3HFHFQCGCWTtohm3soS0R1xZddnC-mzHIfRM0Ja0m91PCjV

(view larger)

But in your live form, the address field is called “Street Address”. When you turn your Zap on and it runs, you’ll see a placeholder error: 

QNtsYzkK77-d232sRXHvngvTuYatfDE06vMs80cE6HUpWj9NeX7_MWnKB21zybV1h0LeZ87dVkc-3u8rqFnAhf8OkiTEyxjcXVaLoCseg10hiqBOGKi4mT4Pr4e0bkRLB4ZMf3_7

(view larger)

This can be confusing, because the address field present in the sample was mapped! In this case, the problem is that the sample used the name “Address” for the field name, and the live run used the name “Street Address”. 

Whenever you see {{...}} curly braces around entries in the Data In of an action, this means that there is a field mapped there in the Zap Editor, but when the Zap ran live this data was not sent from a previous step.

What we can do is create a custom pill mapping with the field name we expect in the live data.

Pill Mapping Code

If you copied and pasted this pill showing “First Name: Steve” from the Zapier Editor into a plain text editor (or even your browser’s address bar, which will quickly remove formatting in your pasted text):

kolg3QkdFsMlqC04XZn7lzwcFIB9WOXs6Bn0aAcV3FuruN9QiRnA-Jr-a3bcnqMvPoMKziRxQ1E0163QsKcG30I4X6teU0voYwJQaKjfb2_nbw3pRdt3sARm5aUFqHRu5ChuKJ7_

(view larger)

 

You would see code that looks like this:

{{122484559__First Name}}

 

This code is made up of two pieces, the Node ID of the step where that information is received and the name of the field where the data is being sent. These two pieces are separated by two underscores.

You can get the Node ID from the URL of the Zap:

D91NR-aZsgpipmA5KBb80Y1RsyXUt-Mxvxih_SNb6X6p7jlHKQTVd_Iizp7PCz_QakAU704TGFZHdVp01qD4pp9_QjnLAewRb9jAiO-qutyxqn2EnY4Gtbfc26THTMgdAL5qycfn

(view larger)

For example, using the Zap at this URL:

https://zapier.com/app/editor/122484559/nodes/122484559

If we are trying to retrieve the field with a name of ‘Street Address’, the construction of this code will look like this:

{{122484559__Street Address}}

When the field is a key/value pair (like First Name: Steve), the key or field name can be used after double underscores, as shown in the example. 

In a case where the field is nested under another field (or multiple fields), each nest would be separated by double underscores. 

For example, if we were trying to retrieve the response for question 3 in the detail below:

zhh19CpeEYGJtcWGJmAa_TvTZXVCZQm1xxnu61CbkDaueVPG3AvQxVYaJEPnPI6LVZQtfUAnT6xBRFzTx06xdr8DdAkfgAkemE4D17Otba657_5wagDVruOMsZHkJShOkRXZxtwA

The code would look like this:

{{122484559__questions__3}}

If you need to extract a line-item array, use square brackets to separate the name of the array and the name of the field, as seen in the example below:

TsIOWReIN7Lf3E8f2HSHs5kRBv8K3YqkR1vkRP69sVvHsfJ57Wlu7W8hKZxWRPuh5pQZ-4UsRMuHfQyRSQqENZg_yOEf-RPZhhAO8eb0HIH6nw1TjU_PeaSE1YoLvXKfJfafPLxa

To extract the value in the field total of them all, the code would look like this:

{{90317686__line_itemsr]total of them all}}

 

Note: You cannot test custom pills inside the Zapier Editor.

Skip the action test and publish the Zap, then test with live data to ensure you are seeing the intended results in the Zap History.

 

Tips

A few tips regarding underscores and spaces:

  • If there are spaces in the field name, include those spaces in your code.

  • If the field name includes underscores, include these in your code as well. Be sure to use the correct number of underscores - if the field name has two underscores, your code should too.

How should we extract similar elements fron an array. E.g. we have some array which has only one lineitem in sample data but there can be more in real data. Here’s how it looks:

lineItems:

   1:

      lineItemId:12345

   2:

      lineItemId:67890


When I copy element available from sample data for line item 1 I get “{{135274102__lineItems1]id}}”, there’s no lineitem number mentioned in element name. In your example I would want to get both quantity fields.


Hey @titsmaker, thanks for the question!

Referring back to my example, you would get both quantity fields by mapping `{{90317686__line_items[]quantity}}`. This pill mapping will deliver all line item values associated with that field name. Depending on the app you’re mapping it into, it will either appear as a string with all of the values separated by a comma, or can be further manipulated as an array. 

So for the array you’re working with, if you’d like to get the `lineItemId` values you can use the following: 

`{{<nodenumber>__lineItemsi]lineItemID}}`

 


Hello @erinoz,

 

I tried your guide but unfortunately it’s not working.
My ZAP url: https://zapier.com/app/editor/146258814/nodes/146258815/fields

I try to pull customfield_21133 in where I saw the value in the test:

Zap still says: 


this is the input i​​​​​​ used: {{146258814__customfield_21133}} and {{146258815__customfield_21133}}.

Can you support here?

Thanks & best,

Melanie


Hey @Melanie Roever!

If the step you’re wanting to select the custom field from is the trigger step then you’ll likely want to use {{146258814__customfield_21133}} not {{146258815__customfield_21133}} - usually the node ID of the trigger step and Zap ID are the same).

It’s normal for the manually selected field to show as “No data” while in the Zap Editor. When the Zap is switched on and runs live, in the Zap history we should be able to see information coming through from that custom field though. Can you try turning the Zap on and trigger it to check that the information in the custom field is passed over correctly?


Hey Is there a limit on how many nested fields you can go down to?

I'm currently trying to use the below and its not pulling in anything

{{84377746__message__partners__partners__name}}

data looks like this in the trigger step

message:
    partners:
        partners:
            partner_id:    
            name:    


Hey Is there a limit on how many nested fields you can go down to?

 

Hi there! I have never encountered a layer, so I think that as long as you “target” the right child key, this should work.

It could be that you need to use:

{{84377746__message__partners__partnerst]name}}

Sometimes, it can be a little hard to figure out whether something is nested or it’s an array.

If more help is needed, please let us know: https://zapier.com/app/get-help.

Cheers!


This helped me out of a jam today thank you!


Hi

 

Is there a video/Youtube Link to this just to make it a bit more clear?


It helps me out. Thanks!


Hi @erinoz , I still don’t see precisely where I’m suppose to change the field name in the zap? Could you clarify please? A video walk through would be great if poss.

Thanks!


I am not getting a placeholding error.  


Hi @damonmanni!

If you aren’t seeing a placeholder error and are still having trouble with your Zap then it’s likely that something else is the cause. If you haven’t already, please could you create a new question about your Zap so that folks can more easily see that you need help. Thanks!


Hi, 

 

Assume if the zap ID is different to my node ID I should use the node ID, right? E.g

https://zapier.com/editor/182421605/draft/183272053/fields

 

 

 

Thanks


Hi @Clive_D!

I’m guessing you’ve likely already figured out the answer to your question here, but thought I’d hop in here to confirm that it’s the Node ID you should use. This is because the Node ID is what is used to indicate what trigger or action step the field is from. 

The Zap ID is the first ID number that appears in the Zap URL. And the second ID number in the Zap URL is the Node ID:
747a7b6f97a3bee8b79c06ca9f249b3c.png

But what can be a little confusing, is that the Node ID for a trigger will be the same as the Zap ID. As shown in the example above, both numbers are the same so it technically makes no difference whether you copied the Zap ID or Node ID as they are the same number. But for referencing fields that are in other actions of the Zap you’d want to make sure you’re always using the Node ID for the action step that that field belongs to.

Hope that helps to clarify! 🙂


Hello, I am having trouble mapping over a custom field from click up that is a drop down type. 

 

I have tried various ways, but have yet to have my zap trigger successfully with these custom pill maps. 

 

For this example I have tried adding all of the possibilities I can think of and sill no luck.

I tried using a single custom code to map over the selected click up field (see below)

{{197227214__name_Audiencesn]Name}} 

or {{197227214__name_Audiences__1}}

Also, I tried adding all of the possible options, like below: 

{{197227214__name_Audiencesd]C-Suite/SVP}}

{{197227214__name_Audiencesd]Internal}}

{{197227214__name_Audiencesd]VP/Directors}}

{{197227214__name_Audiencesd]Sr. Manager/Manager}}

 

Yet, for some reason I get an error code in my Zap history:

Required field "Audience(s) (Custom Field)" (audience_s_1) is missing.

 

Please help!


I’m surprised this bug even exists and that we need this whole workaround, and then can’t even test the workaround with dummy data.

 

If you map an input field to a differently name field in the next step, why wouldn’t Zapier just pull that information in regardless of a field name mismatch, surely Zapier can fix this…

(Or at least force developers to not hard-code these fields before uploading their apps to the Zapier platform that then causes these issues.)


Hi @Justin_tsia and @AP! 👋

@Justin_tsia - I’m so sorry we missed your message here previously! It’s been a long time since you posted it so I expect you may have already solved this but wanted to post a suggestion here for anyone strumbling across this that may be running into the same issue. 

The name_Audiences field doesn’t look like it’s nested or in a line item array so you should be able to just reference the field like this: {{197227214__name_Audiences}}

Which would reference this field:

c3b230da70a38cff081c80c4152af66e.png
But if you wanted to reference the name field that’s within the options under type_config:

8b187126692fe49db883676cda44aec9.png

Then you’d reference it like this: {{197227214__type_config__options__name}} 

Hope that helps! 
 

@AP! - thanks so much for reaching out here with this valuable feedback! 🧡

 I’m surprised this bug even exists and that we need this whole workaround, and then can’t even test the workaround with dummy data.

It’s not a bug as such, as it’s more that some app’s triggers lack the functionality being able to load live test record samples. I’d recommend reaching out to our Support team to put in a feature request for any apps you come across that don’t provide live test record samples. They’ll be able to flag the need for this to the app’s developers so that it can be added in future.

If you map an input field to a differently name field in the next step, why wouldn’t Zapier just pull that information in regardless of a field name mismatch, surely Zapier can fix this…
(Or at least force developers to not hard-code these fields before uploading their apps to the Zapier platform that then causes these issues.)

When mapping fields from a Zap’s trigger they are referenced from the fields present in the test record sample, so currently they aren’t being referenced directly from the app itself. I expect that to change it to automatically pull all available fields directly from the Zap wouldn’t necessarily be an easy or quick solution to implement on our side across all 7,000+ apps. But we should definitely look into ways we might be able to ensure that live test record samples are provided or have some option added that would allow you to pull in missing fields directly from an app if only a default sample is provided.

I’ve passed your comments over to the Product Team so that they can look into how we might be able to improve things from our end. I can’t make any promises on when or exactly what changes they might be able to put in place for this, but we’ll be sure to follow up here once they do! 🙂


Reply