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. 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 ...
  2. Show/Hide Logic based on Drag & Drop Ranking

    This example script conditionally shows pages based on the option that is rated highest and/or lowest in a Drag & Drop Ranking question. These steps assume a basic familiarity with Alchemer and programming. See this script in action in an exampl...
  3. hideoption

    This function hides an answer option by reporting value. The true/false parameter can be used to support changes in answer options when respondents use the back button. See this function in action in an example survey . Parameters* Descripti...
  4. Using CSS Classes in JavaScript

    When you are writing Javascript in SurveyGizmo and need to interact with the DOM, the most straightforward option is often to use the IDs of the specific elements that you are interacting with. For example, here is the HTML for an individual textbo...
  5. Drag & Drop and Ranking Grid: Report on rank not row headers

    Both our Drag & Drop Ranking question and our Ranking Grid will report and export on the row headers for each question. The report data of an aggregated score and a corresponding rank for each row header/option. Some users are more interested in...
  6. Survey Header Image: Change image via a URL variable

    This JavaScript will allow you to change your survey's header image via a URL Variable. This can come in handy if you'd like to show different target audiences different images. In this example, we changed the header to be a different color logo for...
  7. Show a Number of Randomly Selected Rows from a Grid

    As part of our core randomization options, you have the ability to randomize or shuffle column and row order in a grid question. However, there is not a built-in feature to show a random subset of the rows in your grid question. Fortunately, it's pr...
  8. Survey Response Functions

    The survey response functions leverage the SurveyGizmo API to list, add, remove, and replace survey responses.
  9. questionsansweredonpage

    This function returns a count of answered questions on a given page.  Parameters* Description Required Default pageID the ID of the page true type the question type false Defaults to all questions on the page *Pro...
  10. Image Select (Multi): Add N/A option

    The image selection question does not allow you to have an N/A Exclusive option. This tutorial will walk you through adding an exclusive option where no other images can be selected if the N/A option is selected.  See the script in action in an  ex...