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

    This function removes the given emailaddress from the given invite as specified by link ID .  Parameters* Description Required linkID the linkID and can be found in your email campaign true emailaddress the email address to r...
  2. newpdf

    This function creates a PDF object that you can store, build and output and send via the emailsend function.  See this function and other PDF functions in action in an example survey . OR Add a survey with a script with this function and other...
  3. getvalue

    This function returns the value (reporting value) of an answered question (or null, if not answered). For single answer questions, a single value is returned. Multi-answer questions return an array. Grid and custom group questions return a multidime...
  4. 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...
  5. setvalue

    This function populates the response value of the given question. If you wish to set the value of an other textbox use the setothervalue function. Parameters* Description Required questionID the ID of the question true value the v...
  6. pagemap

    This function returns a nested array of page IDs with an array of page elements nested within. All survey pages and elements are returned regardless of where in the survey the function is used. See this function in action in an example survey . ...
  7. 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...
  8. Survey Getter Functions

    Survey getter functions allow you to fetch various values throughout the survey. getvalue and its corresponding survey setter function setvalue are the workhorses of the custom scripting. Note: There are several getters and setters under the L...
  9. gettitle

    This function returns the title of a question. Using the language parameter you can return the title in the given language. The possible values for the language parameter values are the languages available in the translation menu . Languages mu...
  10. Text Fields: Add Placeholder Text

    Placeholder text in text fields is helpful when asking open-text questions that require a specific format e.g., phone number, email address, zip codes, etc. Alchemer has a built-in feature to add placeholder text to Textbox, Number, Email, Percen...