Create variables

About

The beauty of Walnut templates is that you can create a template once and then customize it by converting specific text, images, avatars, or date to variables. This gives tremendous flexibility, removing the need to recreate the wheel or endless copy/paste, saving you time and effort.

In this article, we show how to add different types of variables.


Variable Types

Walnut has four types of variable:

  • Text: The text can be part (or all of a text element or text in a guide). You can add as many text variables as you want.
  • Date: Converts a static date to one that is dynamic based on your chosen time period.
  • Image: Swaps out one image for another across the template.
  • Avatar: Swaps out one avatar for another (but doesn’t use the Variables menu).

Add text variables

You can:

  • Create text variables, knowing that you will want to add them to elements or guides. We’ll call this a ‘stand alone’ variable.
  • Use Find & Replace to find existing text to replace with an existing variable or create a variable ‘on the hoof’.

Create a ‘stand alone’ text variable

Here's the workflow.

To create a ‘stand alone’ text variable:
  1. Click any text element (or right-click it); it doesn’t have to be the one you want to replace with a variable. This opens the Guide toolbar in the header. 
  2. Click the Variable icon. This opens the options for variables.
  3.  Click New Text Variable. This opens the text variable window.
  4. Complete all fields.
    • Name for the variable.
    • Description.
    • Get personalized value from: None, Salesforce, URL, lead form.
      • Enter the additional details depending on the source.
    • Use default value: Enter the text for the variable.
    • Enter the additional details depending on the source.
  1. Click Done. The text element now changes to the text of the variable.
  2. Click the Variables icon again to open the Variables pane to see usage.
  3. If the element you selected was not the one you wanted to change, simply click the text and replace it with the original.
  4. When you open the Variables pane again (step 5), you’ll see that the variable is not yet in use.

Replace text with an existing variable

Here's the workflow.

To replace text with an existing variable:
  1. If you only have one text element to replace, click the element to open the toolbar.
  2. Click the Variable icon.
  3. Select the Variable name from the pane.
  4. That’s it. The text element is replaced with the variable.

Replace text with an existing variable using Find & Replace

Say goodbye to the time-consuming task of searching for text and manually replacing it with a variable. To create variables from existing text, use Walnut’s Find & Replace feature. 

Before you start:

  • Find & Replace finds all text, even including text that is behind an overlay! 
  • If you have variables throughout the template, they will appear in the dropdown menu when you search the text string.
  • In the workflow below, I want to replace ‘Badass Software’ with ‘Badass Software Pro’.

Here's the workflow.

To replace a text string with an existing variable using Find & Replace:
  1. Open the template in edit mode.
  2. Click the parent element. Here it’s the complete Home screen.
  3. Click the Search icon from the Editor sub header to open the Find & Replace pane.


  4. Enter the text you want to replace. The search results for this example show 3 instances.
  5. Next, click in Replace with box and select the variable. In this example, it’s ‘Product name’. The text of the variable shows in the pane.



  6. When you’ve checked the results, click Replace All
  7. You’ll see a ‘heads up’ validation message.
  8. If all’s good, then click Yes, Replace All.

That’s it. All the text is replaced with the selected variable.


Replace text and create the variable at the same time

You realize you’ve entered text and you haven’t yet created a variable. No problem. You can do that all in one workflow. 

Here's the workflow.

To replace text and create the variable at the same time:
  1. Repeat steps 1-4 in the previous workflow.
  2. Click in the Replace with box and select New Text Variable.
  3. This opens the text variable window.
  4. Complete all  fields.
    1. Name for the variable.
    2. Description.
    3. Get personalized value from: None, Salesforce, URL, lead form. The CRM options are: Account: Company Name; Primary Contact: Full Name, First Name and Last Name.
    4. Use default value: Enter the text for the variable.
  5. Click Done. The text element now changes to the text of the variable.
  6. Click Replace All.

Nice job! You’ve replaced all the old text with a variable in one workflow. 


Replace text using a personalized CRM variable

The workflow is the same as the workflow to create a new variable, except you must enter the CRM source details at step 3.


Add image variables

The workflow to swap one image for another is similar to text variables.

Here's the workflow.

To swap out an image for an image variable:
  1. Right click the image and select Variables>New image variable or click the Variable icon in Edit toolbar to open the new image variable screen.
  2. Complete all the details. 
  3. Click Done.

NOTE: The new image will be the default value in the demo, but you can change it by uploading a new one.


Add dynamic date variables

Dynamic date is a built-in variable which allows for the dates within your demo to always be relevant. This is handy when you want to show:

  • the current date
  • tomorrow’s date
  • a date a few months in advance.

Using the dynamic date, you can format the date as you want - ideal for different time zones and countries.

Add a dynamic date variable

Here's the workflow.

To add a dynamic date variable:
  1. Open the template in edit mode and locate the area where you want to add a dynamic date (or replace an existing date). Here, I want to add a dynamic date to the text ‘ Yesterday’s activity’.
  2. Click Edit Content and place your cursor where you want the date to show.
  3. Click the Variable icon and select Dynamic Date to open the Dynamic Date screen.
  4. Enter the format for the date and set an offset if you want. To show yesterday’s date, set the Today offset to -1.
  5. Click Done to complete.
  6. Once applied, a variable tag shows in edit mode.

Remove a dynamic date variable

Here's the workflow.

To remove a dynamic date variable:
  1. Select dynamic date, click the Variables icon and select Remove Dynamic Date.
  2. Alternatively, click the 3 dots icon to open the menu and select Variables>Remove Dynamic Date.

Add avatar variables

Use avatars to personalize your demos. You can apply a demo to appear on every guide within your template, or you can choose different avatars on different guides. Either way, adding an Avatar is a great way to give your guides a voice and personality. 

NOTE: Swapping an avatar doesn’t open the Variable menu, but it functions in much the same way.

Add the same avatar to all guides

Here's the workflow.

To add the same avatar to all guides:
  1. Open the template in Edit mode. From the right hand toolbar, click the Guides icon . This opens  the Guides pane. Then click the Gear icon to reveal all the options.
  2. Select Avatar and upload a new image to change the avatar.

  3. The new avatar will show on all guides.

Add / change an avatar on selected guides

Here's the workflow.

To add / change an avatar to on selected guides:
  1. Open the template in Edit mode. From the right hand toolbar, click the Guides icon . This opens the Guides pane. 
  2. Select the relevant guide.
  3. Click the pane with the highlight to open the edit toolbar above the guide.

  4. Click the Settings icon and upload a new avatar.
  5. The new avatar shows on the guide you selected.

Repeat the process to change the avatar on a different guide.


 

Was this article helpful?
0 out of 0 found this helpful