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

    This function question pipes the given question based on the values specified in the array parameter. See this function in action in an example survey . Parameters* Description Required questionID the ID of the question true ...
  2. getpipevalues

    This function returns an of array the piped values for the given question-piped question. For multi-select questions, an array will be returned. See this function in action in an example survey . Parameters Description Required quest...
  3. settableorderbytable

    This function accepts two table Question IDs and orders the rows of the table in tableID by the table in refID. This allows you to maintain randomization order across tables in your survey. The row headers for both tables must be identical. See thi...
  4. Survey Setter Functions

    Survey setter functions allow you to set various values throughout the survey. setvalue and its corresponding survey getter function getvalue are the workhorses of the custom scripting. Note: There are several getters and setters under the  Log...
  5. Get Started with JavaScript

    What Can I Do With JavaScript? The possibilities are endless. Check out the Working Examples of JavaScript .
  6. Working Examples of JavaScript

    Get started with JavaScript! Learn how to script some of our most frequently requested survey customizations. These examples are built to plug and play. Template scripts like these are great for getting started with JavaScript.
  7. Results Functions

    Results functions allow you to fetch aggregate data to build custom quotas and customize other survey behavior. 
  8. pipematrixrows

    This function pipes the given rows into the given Custom Table question. You can specify a static value or pull selected values from a previous question. Parameters* Description Required questionID the ID of the question true p...
  9. runaction

    This function causes the given action to run and returns true if it is successful (returns false if given questionID is not an action). Parameters Description Required questionID the ID of the question true Example runaction(2...
  10. currentpagesku

    This function will return the SKU (aka ID) of the current page. The below example outputs the current page SKU to the page. print(currentpagesku())