New Routing Type: Run an Askia Script
This new routing type allows you to perform various actions in one routing with the use of new methods.
The new methods available are:
SetValue(arg)
This method works like the “Set Value” action. You can call it by referring to the question you want to set a value into and passing the desired value as a parameter to the method. For example:
If Q1 is a numeric question and you want to set the value of it to 99 you can do the following:
Q1.SetValue(99)
If Q1 is a closed multiple question and you want to select codes 1,3 and 5 you can do the following:
Q1.SetValue({1;3;5})
Skip()
This method works like the “Do not ask” action where you can call this method on a question or chapter. For example:
If age < 18 then
AdultQuestions.Skip()
EndIf
SkipAndKeepData()
This method works like the “Make question invisible” action. You can ‘chain’ this method with another method i.e. Setvalue() in order to set a value into a question and hide it. For example:
If brands has {1;2} Then
Q2.SkipAndKeepData().SetValue({1;2})
EndIf
ChangeSubQuestionsOrder(arg) – Using this method you can change the order of sub-questions to any given order. For example:
Dim randomOrder = {1;2;3}.Shuffle()
Chapter1.ChangeSubQuestionsOrder( randomOrder )
GoTo(arg)
This method works like the GoTo action. You can pass the name of the question to be routed to into this method. For example:
If Q1 Has {99} Then
ScreenOutQ.SetValue({1})
Interview.GoTo(ScreenOutQ)
EndIf
SetLanguage(arg)
You can use this method to change the language of the interview. For example:
If Country Has {2} Then
Interview.SetLanguage(“FRA”)
EndIf
SetScenario(arg) – This method can be used to set the version of the Interview. For Example:
Interview.SetScenario(“user”)