Create your own fields with Named Variables

Create your own fields with Named Variables
Userlevel 4
Badge +1

Have you ever had a Zap that sends a big block of information that you wish you could break apart into separate fields? It turns out you can do just that! I’d like to introduce you to a little known but very powerful Zapier tool called named variables.

Named variables allows you to format your text in a way that when the Zap runs, this text will be separated out and sent as individual fields. The key to using this function is entirely in the formatting of the original information. 

This tool is particularly helpful when you have a big block of text that comes through your Zap in one field, but you’d prefer to use the information in that block of text in different fields in your action step. If we were to send that text formatted with the named variables formatting, the Zap will know to create a separate field with that field name and send through the value in that field.

Let’s look at an example. You have a form on your website that sends you the responses via email. You’d like to add the details of that form entry to your email newsletter service, but the entry arrives in your Zap trigger step like this:

 

f76K7Ec65Ka0-G7g2vd0XWTIObmVaKt7sgiIJbit1g4Zk_fb_b7vEyD-raGxGWrvzJCpTfm7AVGEv8F-HqfDns1oDJLePbK9ec2vjkbHYy_pjy-qlPdHran1h10cPRWjqIsye46Y

 

Now, how do you get the name, the email, the subject, and the message into separate fields in your Zap? You could use Formatter steps to split that block of text, but this could get messy and require a lot of steps to get this text split accurately. A much simpler and all-in-one solution is named variables!

To get this working, we can make a few small tweaks to how that message is sent in your form app, using the syntax for named variables.

This is what that email that sends that format above looks like:

 

ELd3-nFh4Uz-gD3MRvcqS7B4THlrLzme-jrP4YdEMVEAwZmwKSlLjD-EBO6B2wdnSbdG1p0Gvh_VMkKJioNtibLka9_yftKoiqfNNPtBHKzo61AMJbRX63coUE9j-_kSYj9IFJ8P

But, if we make a few tweaks to that email format to use the named variables syntax, we can set it to look like this:

 

jIVqdY4IFykWycyQSTWj-Nw2kwnLipOOxeJkcaMY2zVzW48UcnU8UGQ1hMEmzprKp0HeVs19MML5se35vwm2JEoNA4g06a5fy9u4Zk9hnzWRi7YAQYBtAglJvY6Sm6AEXvnd69DP

 

We’ll see that new formatting in the body of our email, like so:

 

WznlqsoVosowUz4CFv9jNsI6DDrwtZ2SoIt1aWtuF8A-KZzqF_eEd659ltUqC7i_G2EiVC0pIK3ZyZk-QE3eV2cc_cedramBJ_5GfBTTIbSbeaB-5uqFpunWBFndO__1OFX01sal

 

When this entry arrives in our Zap, we’ll get the full block of text and a separate field for each of those variables:

 

q0z4d6YLOZLfL-3Ljcf1AMYN5QSCWkkzyEsat1LW4ADGKYAk7pYq4X51Ctu-F2BJUZddfPUBthEl9l9qrK953jPmqVfayU_wic9w-IW9aScfbrvcNSasNiHsKLHUjnevwNTwLrnG

 

So, with just those few small tweaks we now have four individual fields to use in our Zap, just as we need them.

The named variables syntax is very specific. The structure includes the field name and the value (the information passed in that field). When it’s added to your content, it will look like this:

 

FieldName(Value. Note the value can have multiple words and spaces.)

 

To get this working successfully, we just need to remember a few rules about how to structure your field names:

  1. Use camelCase. This is a coding format that capitalizes the first letter of each word, except the first word in the list. Note that the words are strung together without any spaces between them.

  2. Delete any spaces.

  3. Add only letters, numbers, or underscores.

  4. Put your values in parentheses.

One of the workflows many of our users request is the ability to send out reminder emails about upcoming appointments. Named variables is an excellent way to make this happen.

To do this, we can create two Zaps — the first will set up the appointment in our calendar app, adding all of the information we need using the named variables formatting into the description field:

 

1XkjIKXVRWor2Y-EqOmo3eIXbr7zPlGDVXZlpFvIhNn27K-_57JKyks3BLDiwedbbM5dti5IrTOXtWxEArYMf405z0NKShr6YEWPG2aH6uoNC4IuMhV7_TMN03UOZjhq3vIlvCeA

You’ll see in the description field that we’ve sent through all of the information we received from the form entry using the named variables setup. This detail will then be extracted when we trigger on this information so that we can use these as individual fields in another Zap.

In that second Zap, you’ll see when we get our trigger data from that event in Google Calendar, all of that information formatted with named variables has been separated into distinct fields:

 

IGeAj_20viw8N8x33Z61hJZ0YNjQpVxidIRnbPx6U-4ZiDM6A_WFDc9D0whChWTwU0-uemSp_ZUie02dvt_MzYQTkCzQH1QtqgSmOi_etW6SRHxS1HvqIgp7MvH-3SNH2Kybdunz

 

This allows us to take those separate fields and add them to the corresponding inputs in our send email step:

 

9qIAgEd8uXu5x9lpUnnRt_wgaS6yvEsZoErbcWpiiSuDKkVuyhr466qeUcm5gV2grizd2fPXvt_d_02B5EBNbQgTDAu3pnpphw6Jg5t4EMISo0rZjhYtIuSgUWNXXfBFXVDyif4m

With all of that information in its own field, we can now use that same information to add additional steps, for example, sending a text reminder. You could even add a delay step before that SMS step, so the text reminder goes out the day before the appointment:

 

ZgODwl56D4iIluTG4O0GS6LPvXk9OQCxFjN_uu5m-VjE6EJCSkcnsvFVxbiE50W-3CrBbBm80sPr2IqJ_k0wtjKaJ68Y394EUlMOwMdnHZ6lmLs2YL7Okj_tw_1pufweI37mRmcm

 

This workflow now lets you do a lot more with your information and gives you a lot more power over how it’s sent through your Zaps.

BONUS: One of the other perks of using named variables in your Zaps is that it lets you do this formatting in one step. This means you can split up your text without additional Formatter steps, letting you accomplish your workflow even on our Free plan!

These are just a few of the ways you can use named variables in your Zaps, but the possibilities are endless! What workflows do you currently have in your Zapier account where this could be helpful? I’d love it if you’d share them with me!

 


15 replies

Userlevel 7
Badge +14

Hi @laurie

 

This is such a hidden gem!

Thanks for sharing.

What are some other secret capabilities?

Userlevel 4
Badge +1

@Troy Tessalone All of our built-in tools! I find a lot of people don’t know these exist or how to use them. The lookup table doesn’t get enough love, neither does the pick from list (Formatter > Utilities) though they’re both super-useful for a number of reasons. So, my quest is to start highlighting them. :relaxed:

Userlevel 7
Badge +11

@Troy Tessalone It sounds like my once-upon-a-time idea of an article along the lines of “X things you (probably) didn’t know Zapier could do” could be helpful :)

Userlevel 7
Badge +11

One example of a way to use Named Variables with a Lookup Table:

 

Userlevel 3
Badge +1

Hi Laurie,

Thanks for the tutorial! This looks super useful to me and I have a Zap where I really could use this, but I’m not sure if I’m understanding this correctly.

I have a Slack Workflow (/w Workflow Builder) for Helpdesk Requests where my users have to fill in a form and the output eventually will be pushed to Github, via the Slack message and some postprocessing in Zapier.

However, to eliminate some cleanup steps in my Zap I’d love to make use of these Named Variables, but I also need to preserve my form output for the Slack message for our bug submitters. Is there a way to have the form output have named variables AND doesn’t look confusing to our bug hunters?

This is the output for the Slack message (last step in workflow) which gets picked up in Zapier (ID: 122052904). Form labels are in Dutch mostly, but from top to bottom:

  • Summary
  • Feedback
  • Priority
  • Submitted by
  • Category
  • URL(s)
  • Screenshot(s)

This ends up in Zapier like so:

 

Thanks for your help.

Hi Laurie:

I have successfully created a Zap that captures RingCentral (voice) telephone calls into named variables. The variables are identified in an Action in Outlook that sends an email to me, receipt of which in turn triggers an Outlook rule to send a copy of the email to a Clio Communication Log under a particular Clio Matter ID (which is established by Outlook rules).

Next, I have a Zap triggered by the new Clio Communication Log. This additional Zap creates a Cio Time Activity entry, (with the intention of) using the variables showing in the email that was copied to the Clio Communications Log. I need to call the variables from the previous Zap to complete the Clio Time Activity Entry. I can’t seem to find the right language to call the variables in second Zap (creation of Clio Time Activity). Is this possible?

Userlevel 4
Badge +1

Hi @TWeir!

When you send the information into the Clio Communication Log, how are you sending the information? Are you just mapping the named variable fields directly to specific fields? Or are you sending it again as named variables?

If you were to send a section in that log that again set up your named variables, your Zap that triggers on this new log would then be able to parse out the variables fields so they can be used in that new Zap.

Hope that helps!

Userlevel 4
Badge +1

Hi @jphorn!

The named variables need to be formatted specifically in that format for any Zaps to be able to parse out those fields. 

Without knowing all the exact steps in the workflow or where the information is going, it’s difficult to say how to get this working as you’re after. I would recommend trying it out and then writing in to our support team if you run into trouble with it. That would let us dig in to what’s happening in your Zap.

Thanks!

Userlevel 3
Badge +1

I love named variables, but am currently running into an issue where one ore more input values also have parentheses in them. Is there a way to escape these and preserve them for further processing?

E.g. one of my input values is: “Siri Remote (2nd generation)”, which together with the named variable is confusing Zapier: 

Title(Siri Remote (2nd generation))

 

Userlevel 7
Badge +14

Hi @jphorn 

Try using a Formatter > Text > Encode step: https://zapier.com/help/doc/how-get-started-formatter-zapier#encoding-and-decoding-text

I’m using webhook to GET information from an outside app via their API.  Can this “named variables” programming be done in the web hook phase in Zapier? Or a step after that?

Or, must it be done in that outside app (I dont believe I have access to it).

 

 

Userlevel 7
Badge +11

Hey @KenM, good question! :slight_smile:

To use named variables you would need to apply specific formatting to the structure of the response that’s sent from the API. If you don’t have the ability to change the formatting of the response the Zap would receive then you could potentially use a Code or Formatter step to parse the information you receive in the webhook’s response into separate fields. But these would be separate fields not named variables.

Hope that helps to clarify! 

Thanks for the reply Sam!  Unfortunately I’m not technical enough to know how to change the structure of the incoming API.  (I’m using Zapier WebHook to retrieve poll the GET API URL)

 For us non technical folks it may be very helpful if Zapier develops a “named variable” tool within the Formatter utilities.

If anyone here knows how to format or program the webhook/ GET API data that I’m bringing in I’ll buy them a cup of coffee! (or beer, wine...)
:)

Userlevel 7
Badge +14

@nicksimard For the above comment, believe you wrote an article about using Formatter to create Named Variables.

Userlevel 2
Badge +1

Man, today’s newsletter had this and so many gems! 👏 🎉

Reply