In the Script Manager right now you are able to use variables from your uploaded lists to show to callers in the scripts and in the info box in the top left of their screen.  (Visit the Questions page for more details)


For example:

If you want to show a polling place that you have uploaded you can use:

Your polling place is {{polling_location}} over at {{polling_address}} 

But individual custom fields are limited to 65 characters, so if you want to do a longer or more advanced replacement what can you do? Never fear! Dynamic variables are here!


What are Dynamic Variables?


Dynamic variables are where the script does not worry about the content of the variable, but will show or hide information based on if the variable exists or not for each person in your uploaded list.


For example:

If you have past voting history information for a voter, you may want to give two different messages in your GOTV script to voters and non-voters.

  • Voters: "I see from official voting records that you voted in 2016. Thanks for being a voter!"
  • Non-Voters: "However, according to official voting records it looks like you missed the last election. I want to make sure you have everything you need to vote this year no matter what."

You would be unable to do this using regular variables as the content is over 65 characters and too long to put in a single custom field.

Using dynamic variables, you are able to conditionally show extended content from the script itself without having to put the full text in your uploaded file.


How do you use Dynamic Variables?


Step 1. Prepare your list


Dynamic Variables only care if the custom field content exists in a given row. It does not care about the content of the custom field itself. One set of text in the script will show if the custom field exists for a given row, and another set of text will show if it doesn't exist.


In order to use Dynamic Variables in your script, you must have a custom field in your list that is filled or empty depending on what you want to show.



CORRECT
      WRONG
Screenshot_2018-11-09_13.10.19.png Screenshot_2018-11-09_13.11.58.png


Upload your new list to the Dialer and make sure to note which custom field you used for your dynamic variable, as you will need that later. You are also emailed this information when you upload your list so check your email if you ever forget.     


Step 2. Set up your script 


To set up your script correctly, let's first talk about how the variables work and then show you how to use them. 


The variable is equivalent to an if/else statement:

    The hashtag # in front of the variable {{#variable}} indicates "if variable exists" and should come before the text you want to show.

    The caret ^ in front of the variable {{^variable}} indicates "if variable does not exist" and should come before the text you want to show.

    The slash / in front of the variable {{/variable}} marks the end of the text you want to show, similar to an ending html tag ( e.g. </p> ). 


Therefore for the voting history example above you would use the following:

{{#custom_field_1}}
    I see from official voting records that you voted in 2016. Thanks for being a voter again this year!
{{/custom_field_1}}

{{^custom_field_1}}
    However, according to official voting records it looks like you missed the last election. I want to
make sure you have everything you need to vote this year no matter what.
{{/custom_field_1}}

Note the options are not required to exist together although they can. You can have logic for content that only shows if a field exists, logic for content that only shows if a field doesn't exist, or combine them into one as we do above.  


Inside the tool it would look this this:


Screenshot_2018-11-09_14.15.44.png


You can also use regular variables and dynamic variables in the same question text to build out a full question, which would look like this:


Screenshot_2018-11-09_14.17.12.png


Step 3. Enjoy your advanced dynamic content!


If you did the above correctly your script will now have the following content (highlight added in image for visibility):


    Custom_Field_1:Voted in 2016


Screenshot_2018-11-09_14.57.02.png


    Custom_Field_1:(empty)


Screenshot_2018-11-09_14.57.49.png