Home > How To's, Survey Creation, Survey Logic, Uncategorized > How to: use functions across a script using the Advanced Scripts section

How to: use functions across a script using the Advanced Scripts section

Overview

While scripting a survey you may find out that a certain capability/calculation is needed across the survey (not only in one or two questions). For example a validation rule that repeats itself across many questions like phone number consistency. The Advanced scripts section of the script is meant to contain such functions. Once you’ve written a function in the advanced scripts, you can call that function from anywhere in your script, just by using the function’s name and its parameters (if exist).
This How-To will explain and show how you can set self-made functions in the advanced script and use them in your survey.

Step 1: Add the needed function to the ‘Advanced Scripts’

  1. Click on the ‘Script’ tab.
  2. Click on the ‘Advanced Scripts’ button.
  3. Add the self-made function.

Step 2: Use your self-made function in you survey

  1. For example you can use your function as a Validation rule
  2. For example you can use your function in the Start/End script of the specific question you want that calculation to be executed.

That’s it!

  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: