Inquiry About Implementing Nested Options in a Schema (Option A Displaying Option B)

Alex441
Tera Contributor

Hello everyone,

I am currently working on a project and have a technical question regarding nested options in a schema.

Specifically, I’m trying to figure out how to implement a feature where Option A dynamically displays Option B based on certain conditions.

I’m looking for a solution that links these options in such a way that the selection of Option A controls the visibility and functionality of subsequent options, like the checkbox and label field.

Here’s a simple scenario:
For example, I would like to include a checkbox that, when selected, triggers the appearance of a new tab or field. Once the checkbox is checked, a field would appear where the user could input a label for this new tab.

  • Option A: Checkbox (checked)
  • Option B : A new field appears with a label input, allowing the user to define the label of the new tab. (visible because Option A is checked)

If anyone has worked on something similar or has any suggestions, I would be happy to discuss it further.

Thank you in advance for your help!

2 REPLIES 2

Rajesh Chopade1
Mega Sage

hi @Alex441 

you can achieve this behavior using UI Policies, UI Actions, or Client Scripts. Based on your requirement, I’d suggest a solution involving UI Policies for dynamic visibility based on user selections.

 

I hope my answer helps you to resolve your issue, if yes please mark my answer helpful and correct.

thank you

Rajesh

Alex441
Tera Contributor

Hi @Rajesh,

Thank you for your response! Regarding the Options Schema and the use of UI Policies, UI Actions, and Client Scripts, here’s why these solutions wouldn’t work to handle nested options dynamically:

  1. UI Policies: UI Policies cannot interact with the JSON of the Options Schema. They are limited to controlling the visibility of fields on a form and cannot manipulate options or define conditional behaviors within a schema.

  2. UI Actions: While UI Actions can trigger client-side actions, they cannot dynamically modify the JSON of the Options Schema. They are not designed to manage relationships or dependencies between options within a schema.

  3. Client Scripts: Client Scripts only act on the widget and its display. They cannot manipulate or add options to the JSON of the Options Schema, nor do they have the ability to make options conditional or visible based on certain rules.

While it is possible to modify the JSON of the Options Schema, it is archaic and does not support the addition of dynamic attributes like a Query or visibility conditions.


I hope this clarifies why these solutions are not suitable in this specific case.

Best regards,
Alex