When writing a Custom Question Rendering Package (CQRP) you sometimes need access to the SurveyToGo logic functions and components. In this guide we examine how to access the following components:
- The SurveyToGo User logic functions
- The SurveyToGo Global variables (Vars) object
Accessing the SurveyToGo User Logic functions
You can access many of the SurveyToGo logic functions through this syntax:
where XX represents the function you wish to call so for example, in our CQRP example we used this syntax to retrieve the answer of a question using the Answer() function in the STG_Loaded function:
Please note that some functions might not work correctly due to the differences in the calling mechanisms allowed from with JS. In case you have a specific question about a function please contact the Dooblo support team.
Accessing the Global Variables (Vars) object
If you need to access the Vars object, it is possible but you will need to use the following functions to do so:
Retrieving the value of a Vars entry:
The "valName" should be replaced with the Vars entry you wish to retrieve.
Setting the value of a Vars object from within JS:
The "valName" and "value" need to be replaced accordingly.
Visit us at: http://www.dooblo.net