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. 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...
  2. settextemail

    This function sets the content of the plain text version of a send email action. Parameters* Description Required questionID the ID of the send email action for which you are specifying content true content the email content ...
  3. submitsurvey

    This function submits the data from the current page and records the response as a partial. All data from previous pages will be stored for reporting. Note: this will not submit the current page and move to the next. To do that, use jumptopage ....
  4. newpagepdf

    This function creates a new page in the given pdf. For more info on PHP PDF Creation visit: https://github.com/rospdf/pdf-php/blob/master/readme.pdf Parameters Description Required pdf The title of the PDF you are creating. tr...
  5. 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 ...
  6. Email Campaign & Action Functions

    Functions that allow for managing Email Campaign contacts and sending emails within a response.
  7. Survey Response Functions

    The survey response functions leverage the SurveyGizmo API to list, add, remove, and replace survey responses.
  8. 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...