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:
- 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.
- Click the Variable icon. This opens the options for variables.
- Click New Text Variable. This opens the text variable window.
- 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.
- Click Done. The text element now changes to the text of the variable.
- Click the Variables icon again to open the Variables pane to see usage.
- If the element you selected was not the one you wanted to change, simply click the text and replace it with the original.
- 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:
- If you only have one text element to replace, click the element to open the toolbar.
- Click the Variable icon.
- Select the Variable name from the pane.
- 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:
- Open the template in edit mode.
- Click the parent element. Here it’s the complete Home screen.
- Click the Search icon from the Editor sub header to open the Find & Replace pane.
- Enter the text you want to replace. The search results for this example show 3 instances.
- 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.
- When you’ve checked the results, click Replace All.
- You’ll see a ‘heads up’ validation message.
- 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:
- Repeat steps 1-4 in the previous workflow.
- Click in the Replace with box and select New Text Variable.
- This opens the text variable window.
- Complete all fields.
- Name for the variable.
- Description.
- 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.
- Use default value: Enter the text for the variable.
- Click Done. The text element now changes to the text of the variable.
- 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:
- 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.
- Complete all the details.
- 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:
- 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’.
- Click Edit Content and place your cursor where you want the date to show.
- Click the Variable icon and select Dynamic Date to open the Dynamic Date screen.
- Enter the format for the date and set an offset if you want. To show yesterday’s date, set the Today offset to -1.
- Click Done to complete.
- Once applied, a variable tag shows in edit mode.
Remove a dynamic date variable
Here's the workflow.
To remove a dynamic date variable:
- Select dynamic date, click the Variables icon and select Remove Dynamic Date.
- 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:
- 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.
- Select Avatar and upload a new image to change the avatar.
- 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:
- Open the template in Edit mode. From the right hand toolbar, click the Guides icon . This opens the Guides pane.
- Select the relevant guide.
- Click the pane with the highlight to open the edit toolbar above the guide.
- Click the Settings icon and upload a new avatar.
- The new avatar shows on the guide you selected.
Repeat the process to change the avatar on a different guide.