SurveyGizmo's CustomScript Action now supports the LUA programming language.
Legacy Custom Scripting Language Deprecation Plans
New accounts (created after October 29, 2018) will only have the option to use Lua in scripts.
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.
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.
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.
This function returns the average answer for the given question ID from all complete responses that have been processed. The average that is returned will not include data from any responses that haven't been processed; this includes the current response when the script is run.
If you are averaging the values for a question with options (Radio Button, Dropdown, Checkboxes) the function requires numeric reporting values.
You can also average numeric responses in a Textbox or Textbox List question using this function. In the case of a Textbox List, the responses to all row headers will be included in the numerator. Each answered textbox in a Textbox List question will increment the denominator, For example, a Textbox List question with 4 questions will use a denominator of 4 (provided they are all answered) to compute the average.
query allows you to optionally specify a query string variable to filter by. Like this: "urlvar_department=support" will return the average value for this question for respondents with the department "support".