How to Use Dynamic Variables

  • Updated

When writing texting or phone banking scripts, you can incorporate "dynamic variables", or {{dynamic_variables}}, into the script. There are a number of dynamic variables that exist as a default within Impactive's system, listed below. Additionally, you can create your own dynamic variables. 

How to Create Dynamic Variables

You can create a custom field and then utilize any of the custom field "slugs" as a column in a CSV header. When you upload a contact list with those column headers, the custom fields will populate when you include the dynamic variable in your texting or phone banking script. 

Example: 

1. Create a Custom Field for "Issue ID" as a SelectionField, with response options of "Immigration" "Healthcare" "Education". (If you are looking to create a dynamic variable with many results you can do this by creating a Custom Field as a TextField) 

2. Upload a CSV with columns of phone, first_name, last_name, VAN_ID, AND with a column with the slug issue_ID for all contacts for whom you know their issue ID.

3. This will allow you to utilize the slug {{issue_ID}} within a script, and have it populate with "healthcare, immigration or education". 

4. IE, "Hello {{first_name}}, this is {{user.first_name}} from Selina Meyer's campaign. I know that {{issue_ID}} is really important to you, and it's vital to Selina as well. 

There are a number of other variables you can refer to if you are doing voter registration through Impactive. 

A few general ones:

  1. You can use variables in your script, such as {{first_name}} to reference the name of the contact, or {{user.first_name}} to reference the name of the volunteer. Most peer-to-peer texts begin by using a contact’s first name.
  2. You can also use the {{custom_field_remind_a_friend}} dynamic variable to insert the names of friends that voters have shared they'll remind to vote.

FAQs

I uploaded a custom dynamic variable, but when I try to use it in the action, nothing shows up. What gives?

  • Check to see if you have a custom field for the dynamic variable created. A custom dynamic variable needs to have a corresponding custom field.
  • Check your upload and ensure that the column headers were named correctly. The column header for the custom dynamic variable needs to use the custom field slug. For example, if the custom field is called "target_district", the header needs to be called "custom_field_target_district". Reupload your list with the correct headers if this was done incorrectly the first time.
  • On your action script, make sure you are calling the custom field correctly. For a custom field called "target_district", that variable needs to look like {{custom_field_target_district}}.

Can I refer to specific voting information in my scripts?

If you have the Voter Registration Feature turned on, you can use the below variable to populate a contact's voting information or take them to the appropriate next step in the voter registration flow on Impactive.

  • {{impactive_check_registration_link}} - This will take the contact directly to your Impactive registration link to confirm their current registration status.

Here is a comprehensive list of all available dynamic variables:

Information Types

Contacts

  • {{first_name}}
  • {{last_name}}
  • {{full_name}} (or {{fullname}})
  • {{email}}
  • {{phone}}
  • {{state_abbrev}}

Campaigns

  • {{campaign.name}}
  • {{campaign.description}}
  • {{campaign.join_code}}
  • {{broadcast_phone_number}}

Users

This is for the user sending the message, and won’t be available in Broadcast Messages, for example.

  • {{user.first_name}}
  • {{user.last_name}}
  • {{user.full_name}} (and {{user.fullname}})
  • {{user.email}}
  • {{user.phone}}
  • {{user.team_code}}

Custom Links

These are a little different and you can copy the correct string from the Custom Links section of the admin area, from the Campaign info page or an Opt-In’s Share tab

  • {{‘SLUG’|trackable}} - Replace SLUG with the slug of the Custom Link.  This will create a trackable version of the link and allow us to tie clicks back to the activity, user, message, opt-in or contact.

Custom Fields

  • All of your custom field values are available as tags that will be replaced with either the value assigned to the user or the default value.  You just put the slug between {{ and }} and it should replace it.

Opt-Ins

  • {{opt_in_form.title}}
  • {{opt_in_form.subtitle}}
  • {{contact_referral_link}} - This will only work in the initial response script or followup scripts related to an opt-in form.  It gives each contact that’s opted into an opt-in a unique URL that allows you to track opt-ins by the contact that shared the link.

Happy Texting!

Was this article helpful?

/