SetDisplay causing variable misalignment on Service Portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2025 05:26 AM
Hi,
I've run into a peculiar issue while developing a record producer.
We differentiate users by a certain criteria. Depending on this criteria, UI policies (through a script, not UI policy actions) hide or show certain fields on the record producer portal form. For this specific form I am talking about, we have two containers, one called "personal_information1" and the other one called "personal_information2". The first container's variables are all read only, and they represent the current state of data. The second container's variables are editable, and allow the user to input their new desired state. Both containers are set to "2 Columns, alternating sides".
In the first container, we have these variables: "Maiden last name" and "Citizenship", as shown:
When the criteria is not met, "Maiden last name" needs to be hidden. I did this using setDisplay() in a UI policy, however it still leaves a blank space:
For the second container, we have the following variables: "First name", "Maiden last name", "Last name", "Citizenship", "2nd citizenship", "3rd citizenship", like this:
However, when "Maiden last name" is hidden (using setDisplay() on a different UI policy), there is no blank space, but the order gets misaligned:
So I would expect, when we hide "Maiden last name" in container 2, that the order goes from this:
First name | Maiden last name
Last name | Citizenship
2nd citizenship | 3rd citizenship
to this:
First name | Last name
Citizenship | 2nd citizenship
3rd citizenship
since it's set to alternating sides.
This is how the second container looks inside the recprod record:
Question | Name | Type | Order |
Personal information | personal_information2 | Container Start | 5000 |
First name | e_first_name | Single Line Text | 5100 |
Maiden last name | e_maiden_name | Single Line Text | 5200 |
Last name | e_last_name | Single Line Text | 5300 |
Citizenship | e_citizenship | Select Box | 5400 |
2nd citizenship | e_2nd_citizenship | Select Box | 5500 |
3rd citizenship | e_3rd_citizenship | Select Box | 5600 |
(empty) | formatter7 | Container End | 5700 |
Does anybody know what might cause this? I quintuple-checked, I only hide variables by using setDisplay(), and it's only in UI policies, not in Catalog Client Scripts. I also don't use ANY UI policy actions, but when I do, nothing changes...
Thank you in advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2025 08:27 AM
You can try to change the container to one side then the other, add a Container Split type variable, and reorder to define what should be on the left / before or right / after the split. You could also try a UI Policy action instead of script or Catalog Client Script to see if the results are different.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2025 12:54 PM
Hi, and thank you for your response!
I have already tried using UI policy actions and controlling visibility from catalog client scripts, and they unfortunately change nothing 😞
Regarding your Container Split suggestion, could you please go into more detail? I don't know how I would accomplish what I need with Container Splits, I've tried something but it didn't work, just kept variables that were originally on the left to stay on the left, and those on the right to stay on the right.