System Functions

Top  Previous  Next

 

Function

Description

Answered (QuestionName)

Is true if the question was answered by the respondent, false otherwise.

Browser ()

Returns the web browser name and version number that the respondent is using.

BooleanToNumber (Boolean)

Converts a variable of type "Boolean" to type "Number". Useful when using a boolean in a numeric function.

Debug ()

Returns debug information to help you test the survey.

EncodeForURL (QuestionName)

Converts characters that are not valid for use in URLs to URL-supported strings.

GetValue (QuestionName)

Returns the saved value of the given question or variable name.

GraphicsPath ()

Returns the system path to where the graphics are located.

IPAddress ()

Returns respondent's IP Address.

JavaScript ()

Returns 1 (true) if the respondent has JavaScript enabled. Otherwise returns 0 (false).

Label (QuestionName)

Returns the label that is associated with the answer to a select single response type question.

NumChecked (QuestionName)

Returns number of response options checked.  QuestionName can be a select checkbox (i.e. Q1) or a row or column of checkboxes from a grid (i.e. Q1_r1 or Q1_c1).

NumberToBoolean (Number)

Converts a variable of type "Number" to type "Boolean". Useful when using a numeric value in a function that expects a boolean.

NumberToString (Number)

Converts a variable of type "Number" to type "String". Useful when using a numeric value in a function that expects a string.

OperatingSystem ()

Returns the name of the computer operating system used by the respondent.

PageNumber ()

Returns the current page number.

ProgressBar ()

Returns the progress bar to the screen. Typically placed in the Page Header or Page Footer.

ProgressBarOff ()

Turns off the progress bar on the page where it is placed.

ProgressBarSet (Value)

Sets the progress bar to the Value.

QuestionName ()

Returns the name of the current question. Must be placed inside of a question (or the question's skip logic).

RandNum (Seed)

RandNum (Seed, Min, Max)

Returns a random number. The "Seed" is any integer and is used to specify a unique random number between 0 and 1. For example RandNum(1) will return a random number between 0 and 1. RandNum(2) will return a different random number between 0 and 1. If RandNum(1) is used again in the survey it will return the same random number to the respondent.  Random numbers are different for each respondent. If Min and Max are specified this function will return a random integer value from Min to Max.  

RemovePrevious ()

Removes the previous button from the page where it is placed.

RespNum ()

Returns the internal respondent number, a unique number that identifies the respondent.

ScreenWidth ()

Returns the width of the respondent's browser screen (in pixels). This can be used to detect if the respondent is on a mobile device.

SetValue (QuestionName, Value)

Stores to the data record the value for the given QuestionName. Warning: will overwrite existing data in the target QuestionName.

Shown (QuestionName)

Returns 1 (true) if the question has been seen by the respondent, or 0 (false) if the question was not seen by the respondent.

SysRand ()

SysRand (Min, Max)

Returns a random number seeded by the system clock (different seed every time instruction is encountered). If Min and Max are specified this function will return a random integer value from Min to Max.

SystemTime ()

Returns a number representing the current time (number of non-leap seconds since January 1, 1970).

ToolTip ("LinkText", "HelpText")

ToolTip ("LinkText", "HelpText", Width)

ToolTip ("LinkText", "HelpText", Width, Height)

Creates a tool tip for "LinkText". When the respondent moves their mouse over the top of this text, a box will be displayed with "HelpText" in it. To include images in a ToolTip see Additional Help

TotalPages ()

Returns total number of pages in the survey.

UserAgent ()

Returns the user agent text sent from the respondent's browser.

WriteLog ("Message")

WriteLog ("Message", Type)

Writes a message to the Survey Log. This log is available via the Survey Admin page. Type (optional) is a number representing the type of log entry. For Type enter 1 for an "error", 2 for a "warning", and 3 for a "notice".

Page link: https://www.sawtoothsoftware.com/help/discover/manual/index.html?system_functions.html