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

    This function returns the list of responses for the given survey. This is equivalent to a get list on the SurveyResponse object via the RestAPI. To learn more visit the SurveyResponse API Object documentation. Parameters* Description Require...
  3. listremove

    This function removes the given response from the given survey. This is equivalent to deleting a SurveyResponse object via the RestAPI. To learn more visit the SurveyResponse API Object documentation. Parameters* Description Required su...
  4. 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...
  5. listreplace

    This function replaces the given response for the given survey with the array items. This is equivalent to updating a SurveyResponse object via the RestAPI. To learn more visit the SurveyResponse API Object documentation. Parameters* Descrip...
  6. 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 ...
  7. 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...
  8. 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...
  9. 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...
  10. evaluatemergecodes

    This function returns the value for the given merge code. Merge codes need to be wrapped in single quotes ' ' so that they are represented as strings. Parameters Description Required mergecode the merge code you wish to evaluate true ...