Multiple Dependent fields in single form.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2023 08:08 AM
Hello Team,
I'm attempting to add five dependent fields to a single form under the following circumstances:
I have table A (where my record is) and table B (which will be the reference table for my 4 fields), and the condition is that field 1 is auto-populated, field 2 will be single select based on field 1, field 3 will be list type of multi select based on field 3, field 4 will be again multi select based on field selections, and field 5 will at the end be selected again based on the other 4 field selections.
Is there a simple way to construct such logic.
As it is well known that multi-display true cannot be done in a single table, this is additional challenge am I facing when using script include to achieve this.
Is there another way to include various display values in the same table?
Please advise that this is a pressing need.
Thank you in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2023 08:53 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2023 10:18 AM
Hi @Tehreeem ,
Yes, it is possible to have multiple dependent fields in a single form in ServiceNow. Here are some general steps to follow:
- Create table A and table B.
- Create the fields you need on table A, including the 5 dependent fields you mentioned.
- Configure the dependencies for each field. For example, for field 2, set the "Dependent" field to field 1 and specify the "Choice List" that should be displayed when field 1 is selected. Similarly, for field 3, set the "Dependent" field to field 2 and specify the "List" that should be displayed when field 2 is selected.
- Repeat step 3 for each of the remaining dependent fields, configuring them to be dependent on the appropriate preceding field.
If you need to have multiple display values in the same table, you can use UI Macros. UI Macros allow you to define reusable pieces of UI, including multiple display values, that can be used in multiple places in the system. You can then reference the UI Macros in your forms to display the desired values.
Alternatively, you can use Script Includes to achieve more complex functionality for your dependent fields. You can use Script Includes to create a more dynamic dependency structure that can change based on certain conditions or business logic.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2023 11:12 PM
Hello @Ratnakar7 ,
Thank you for your response, let me tell you bit more detail for my requirements ,As in 2nd field I will be having one to many kind of dependency (i.e between field1 and field2), So I cannot add dependent value.
Can you please guide me how can I go with ui macros to bring the value of the fields which I want instead of display value of the table.