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 response count for the given question ID from all responses that have been processed. The response count 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.
You can query the total response count for a question using the questionID parameter. Or, pass an optionID to return the response count for a particular answer option. You can also filter by response status using the status parameter.
Example 3: Get response count for a specified response status
If you wish to get the response count of a question and specify the response status but have no optionID to specify the syntax is like so:
questionID = 2
optionID = ''
status = "Complete"
getquestionresponsecount(questionID,optionID,status)
Example 4: Use getquestionresponsecount in combination with resultsquestiontotal to compute an average
getquestionresponsecount can also be used in combination with resultsquestiontotal to calculate an average. For example, if question ID 2 asks for the number of guests you will be bringing to the party, then we can calculate how many guests each person is bringing on average.
qID = 2
guests = getquestionresponsecount(qID)
people = resultsquestiontotal(qID)
guestsPerPerson = guests / people