Skip to content

Using variables in messages

nditada edited this page Jan 15, 2018 · 1 revision

Messages in Aida can use variables to make their content dynamic. You can interpolate a variable in any message like this:

Hello ${first_name}, how are you?

While variables are always used in the same way, there are 3 different sources for them:

Facebook Profile

Aida pulls 3 variables from the respondent Facebook profile: first_name, last_name and gender

Surveys

Any XLSForm survey you import will have a column "name". Each question you created in the survey will have a value in that column. Check that column to know which is the name for that question's response: that's the variable name you can use in Aida.

Content

Using the Variables screen (inside the "Translations" section) you can define your own variables as well, and use them in any message. Since those variables will have the same value for every user, they require translations.

Conditional variables

Once you created a variable, clicking on the "+" sign left to your variable, you can define different values for different conditions.

You can define any condition using other variables, like

${location} = 'rome'

Clone this wiki locally