Save Variables – SetValue() – GetValue()

In SSI Web v8 you can now easily save variables using the new SSI Script SetValue() function.  Any existing question fields in the database can be set.

SetValue(QuestionName, Value)

For example:

[%SetValue(Q1, 5) %]

would set the value for Q1 to 5 in the database.

Currently we do not have a place in the SSI Web interface where you can specify variable names.  One work around is to use Pass-In Fields (located in the Start question) to setup variables that can be used by SetValue().  For example you could create a Pass-In field named “age”.  You could then set the value for “age” to 45 midway through the survey using the following command:

[%SetValue(age, 45) %]

To retrieve the value for age you can use:

[%GetValue(age) %]

which returns the current value for age stored in the database.