sgapiGetQuestionRuntimeProperty(%%questionID,%%property)

Important Update to Custom Scripting

SurveyGizmo's CustomScript Action now supports the LUA programming language. Visit our NEW Lua Scripting Resources!

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. The exact date on this is to be determined; we will send notifications well ahead of time.

This question returns the specified runtime property for the given question ID.

Possible Properties Return Values
Hidden boolean
Required boolean
Soft-Required boolean
Disabled boolean
Rendered boolean
Answered boolean
Answered (text fields) boolean
Number (Question number) question number e.g. 1.
Comment This pulls the objects that include the raw data from Comment Fields

Example

In this example we use the runtime property "Number," which returns the question number assigned to the question by ID at runtime. Then we concatenate these values to store the unique random order of the questions for this response. Finally, we set the value of a textbox equal to this random order to store for later reporting.

Check it out in an Example Survey

%%property = "Number";

%%q1 = sgapiGetQuestionRunTimeProperty(2,%%property);
%%q2 = sgapiGetQuestionRunTimeProperty(3,%%property);
%%q3 = sgapiGetQuestionRunTimeProperty(4,%%property);

%%randomorder = %%q1 . %%q2 . %%q3;

sgapiSetValue(8,%%randomorder);