Lua Scripting Resources

Important Update to Custom Scripting

SurveyGizmo's CustomScript Action now supports the LUA programming language.


Legacy Custom Scripting Language Deprecation Plans 

  1. New accounts (created after October 29, 2018) will only have the option to use Lua in scripts.
  2. As of October 29, 2018 Custom Scripting Actions will default to Lua as the scripting type in the Custom Scripting Action for accounts created before this date. You will be able to switch to the Legacy Custom Scripting; though we highly encourage using Lua.
  3. In the long term, Legacy Custom Scripting Actions will be switched to read-only. Read-only scripts will continue to function; you will just be prevented from editing. The exact date on this is to be determined; we will send notifications well ahead of time.


 Go to our Legacy Scripting Documentation.

While SurveyGizmo is one of the most flexible survey tools around, we get requests for customizations that are not available out of the box. This is where JavaScript and Custom Scripting can save the day. If you have scripting chops you can use the JavaScript action or the Custom Scripting action to achieve the survey of your dreams.


Updated Articles

  1. jumptopage

    This function jumps the respondent to the specified page ID. See this function in action in an example survey . Parameters Description Required pageid the ID of the page true Example In this example, respondents who answer ...
  2. hidepage

    This function hides or shows a page. See this function in action in an example survey . Parameters* Description Required pageID the ID of the page true true/false true hides the page, false shows the page true *Provi...
  3. getpipeskus

    This function returns an array of SKUs=>values for the given question-piped question. See this function in action in an example survey . Parameters Description Required questionID the ID of the question true For example, if we que...
  4. disqualify

    This function disqualifies the user and ends the survey. message will display your customized message to the respondent. See this function in action in an example survey . Parameters Description Required message the message to display ...
  5. getpagepipedanswers

    This function returns an array of the piped values for the given page-piped question. See this function in action in an example survey . In the below example, we output the values of question ID 8 which is page-piped from a question on a previous...
  6. setquestionruntimeproperty

    This function sets the specified runtime property for the given question. See this function in action in an example survey . Parameters* Description Required questionID the ID of the question true property the property you wish to...
  7. setpagestartingnumber

    This function sets the number of the first question of the page (default is 1). You can use this script on each page to restart the question numbering on each page. See this function in action in an example survey . Parameters Description Re...
  8. referrer

    This function returns the URL of the webpage that linked to the survey for the given respondent. Example In the below example survey we output the Referrer to the page which is this tutorial! print(referrer()) Note: The referrer is not always a...
  9. getvaluelabel

    This function returns the answer option title of the selected answer option (or null, if not answered). For single-select questions, a single value is returned. Multi-select and matrix questions will return an array. Using the language parameter ...
  10. gettablequestionskus

    This function returns an array of SKUs (aka IDs) for the given table. This can also be used to get the SKUs for the subquestions in Custom Groups. See this function in action in an example survey . Parameters Description Required que...