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. urlvalue

    This function returns the value of a query string variable passed into the survey where urlkey is the URL variable key.   Note: URL variable keys are stored as all lower case in our system.  Parameters Description Required urlkey...
  2. Pipe two questions into one

    Piping is a great way to use a respondent's answers from one question in a survey in another question on a later page. But what if you want to pipe from not one, but two or more questions into one question on a later page? We have a workaround that...
  3. Update Hidden Values if answers are changed

    By default, hidden values do not update when respondents go back in a survey and change their answers. One way to solve this problem is to remove the Back button on a survey, but that still doesn't ensure that they can't click Back on their browser....
  4. Continuous Sum: Combine sums from two Continuous Sum questions

    Would you like to add the totals to from one or more Continuous Sum question on the same page?* This script displays the sum of one or more Continuous Sum questions on the page. Note, this does not record the summed value for reference later; see o...
  5. getqueryresponsecount

    This function returns the number of responses (completes) that have been collected for the current survey. It takes an optional urlvar_key=value parameter that filters by a URL variable. urlvar_key=value should be in the following format: "urlvar_ke...
  6. renderquestionhtml

    This function renders the entire question including all the HTML associated with both the question title, description and answer options. Parameters Description Required questionID the ID of the question true Example In the b...
  7. Radio Button Grid: Only allow one selection

    Radio Button Grid questions allow a single selection per row. Some customers have requested the ability to allow only a single selection for the entire grid. While we don't have a built-in way to achieve this, you can set this up pretty easily wit...
  8. Buttons: Remove back button on one page

    This JavaScript will hide the back button on that page that it has been placed on. In the example survey below, the back button is hidden on the third page.  See this script in action in an example survey .  OR Add a survey with this script an...
  9. Prevent respondents from selecting text

    In some circumstances, users do not want their respondents to be able to select text. This tutorial provides some JavaScript to help prevent that.  See the script in action in an example survey ! OR Add a survey with this script and setup to y...
  10. listadd

    This function posts a response to the given survey using the array of items. This is equivalent to creating a SurveyResponse object via the RestAPI. To learn more visit the SurveyResponse API Object documentation. Parameters* Description Req...