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.


Popular Articles

  1. Randomization: Maintain random order across questions

    This JavaScript will allow you to maintain randomization order for images in Image Choice questions. We'll cover how to do set this up with Image Select questions on the same page and separate pages. This script also stores the random order that w...
  2. setcustomtablevalue

    This function allows you to set the value for an individual cell in a custom table question. Parameters* Description Type Required columnID the question ID of the Custom Table integer true rowname the row header text intege...
  3. Enter Key: Disable the Enter key in your survey

    When you have survey pages with open text fields, it's possible for a survey respondent to submit the page by accidentally pressing the Enter key before completing their response. With this bit of code, you can ensure that won't happen! Place this ...
  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. 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...
  6. isanswered

    This function returns a Boolean true if the given question has been answered. Parameters Description Required questionID the ID of the question true Limitations isanswered is not supported for the following question types. ...
  7. 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...
  8. pagemap

    This function returns a nested array of page IDs with an array of page elements nested within. All survey pages and elements are returned regardless of where in the survey the function is used. See this function in action in an example survey . ...
  9. Pipe Checkboxes to Slider List

    The built-in piping feature is not supported for Slider List questions. Fortunately, we can achieve piping in this question type via the custom script as illustrated here. For this to work the target question must be set up with slider row headers ...
  10. listreplace

    This function replaces the given response for the given survey with the array items. This is equivalent to updating a SurveyResponse object via the RestAPI. To learn more visit the SurveyResponse API Object documentation. Parameters* Descrip...