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.


New Articles

  1. getsurveyprogress

    This function returns the percentage progress based on survey pages. See this function in action in an example survey . Example If the below script is placed at the top of each survey page of a six-page survey (including the Thank You page) the ...
  2. getquestionoptionselected

    This function returns the option ID for the selected answer. For multi-select questions, an array will be returned. See this function in action in an example survey . Parameters Description Required questionID the ID of the questio...
  3. 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 ...
  4. getquestionproperty

    This function returns the given property for the given question ID. Parameters* Description Required questionID the ID of the question true property the property you wish to lookup true *Provide parameters in the above o...
  5. getrespondentsessionid

    This function returns the session ID for the current response. Session ID is a unique, randomly generated string used to identify the respondent's survey session. Example session = getrespondentsessionid() print(session) The output would be: 139...
  6. gettablequestiontitles

    This function accepts the Question ID of a table and returns an array in the following format: [questionID] => "title"  See this function in action in an example survey . Parameters Description Required questionID the ID of the questio...
  7. allquestionsoftype

    This function returns an array of all the questions (of a particular type) on a particular page. Parameters* Description Required type the question type true pageid the ID of the page true *Provide parameters in the above order...
  8. ishttps

    This function returns a boolean for whether or not the survey link is set to secure (https). Example In the below example we're running a snippet of code if the link is secure. if (ishttps() === true then -- code end ...
  9. 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. ...
  10. hidequestion

    This function hides the specified question when set to true and shows the specified question when set to false. Parameters* Description Required questionID the ID of the question true true/false true hides the question and fa...