Developer Documentation Library > Interview templates > UXUI custom properties > uxui_page_interview_filter
 
uxui_page_interview_filter
Use uxui_page_interview_filter to define a public function used to set a page filter.
This function is called when the page is displayed and when a response is chosen on the page. The page filter returned by the function is used to dynamically hide and show questions in the page.
Set MustAnswer must be set to “false” for the page, to avoid errors when calling the public function, because all questions are rendered into the page.
Applies to
page
Example
The following example uses the D1PageFilter function to update the filter based on the response to the D1_Q1 question. Then the page is updated to show additional questions; it can be further updated based on the responses to those questions.
Metadata
page1 -
[
uxui_page_interview_filter = "D1PageFilter"
]
page(
D1_Q1,
D1_Q1_0_1,
D1_Q1_0_2,
D1_Q1_0_3,
D1_Q1_1,
D1_Q2,
D1_Q2_0
);
Routing
IOM.PublicFunctions.Add("D1PageFilter")
IOM.MustAnswer = False

Function D1PageFilter (IOM, Answers)
Dim AnswersObj
Set AnswersObj = JSONDeserialize(Answers)
D1PageFilter = "D1_Q1"
If (AnswersObj.D1_Q1 = {Yes}) Then
D1PageFilter = D1PageFilter + ",D1_Q1_0_1"
End If
If (AnswersObj.D1_Q1 =* {No,NotSure}) Then
D1PageFilter = D1PageFilter + ",D1_Q1_0_2"
End If
If (AnswersObj.D1_Q1_0_2 = {No}) Then
D1PageFilter = D1PageFilter + ",D1_Q1_0_3"
End If
If (AnswersObj.D1_Q1 = {Yes} Or AnswersObj.D1_Q1_0_2 = {Yes}) Then
D1PageFilter = D1PageFilter + ",D1_Q1_1"
End If
End Function
See
UXUI custom properties