The CreatorCon Call for Content is officially open! Get started here.

I am trying to present few questionnaires when a category is selected.

runfast
Kilo Guru

 

I am trying to create a record producer with a few questions. One of the questions involves selecting a category (I’ve already created a category list in the table), and I’m using a lookup to display it on the form. Based on the selected category, I need to present a set of related questions.

Example:

Category options:

  • Car
  • Color
  • Bills

If “Car” is selected as the category, the following questions should appear:

  • What is the car model?
  • What is the car color?
  • What is the purchase date?

I’m working on a Catalog UI Policy to control the behavior after creating the questions, but I’ve found that the behavior is not consistent. Is there a better way to implement this?

1 ACCEPTED SOLUTION

Make sure you are using the correct Value for category in the script, not the Text/label depending on what type of variable this is.

BradBowman_0-1758112406163.png

 

View solution in original post

7 REPLIES 7

Brad Bowman
Kilo Patron
Kilo Patron

A Catalog UI Policy is the recommended method for making fields or variables visible, read only and/or mandatory.  Under what testing conditions/steps are you seeing inconsistent behaviour? Post some screenshots of how you have this configured and we'll get it sorted.

I am able to reproduce the inconsistency behavior, and I hope this shade some light.

here is my UI policy for a specific category called:

runfast_0-1757966135737.png

Here is a Try it screenshot where it shows hidden variable based on the UI Policy:

runfast_1-1757966237766.png

But if a refresh it few times it shows the correct variable "Property Name". 

Here is the variable setup for Amount:

runfast_2-1757966770948.png

The "amount" variable also seats on another UI Policy with "show/visible" where we need it be visible under a different category.

Any guidance or direction greatly appreciated.

 

 

 

 

 

 

 

The other UI Policy explains why you are seeing Amount when the Estoppel category / Due Diligence Type is selected. When there is more than one UI Policy affecting the same field/variable, you can try to use the Order field (add it to your UI Policy Form or list view) to set a different execution order for each so that maybe you will get the intended results, but at least they will be consistent. In this case it would probably be best to inactivate all of the UI Policies and have a Client Script do these actions onChange of category with a series of if statements for each category choice to make each variable mandatory and/or visible.  Just remember to use g_form.setMandatory prior to g_form.setDisplay when hiding the variable as mandatory variables cannot be hidden.  Once you have that working onChange you may want a similar script onLoad of the target table so that the variables behave correctly when a record is loaded with the category already selected.

Thanks for the Catalog Client Script suggestion! I got the onload piece working and now I am working on the onChange type where I need to display variable based on category selection. 

I am not sure what I am doing wrong but i could not get the 'location' variable show when "Financial" category selected. 

 

runfast_0-1758058057667.png

Here is the category setup:

runfast_1-1758058344118.png