How to create dynamic input fields ( variable number of input fields ) in the UIB page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2022 12:07 PM
Hello ,
i have a need to get variable number of user input fields created in the UIB page.
the number of input fields can vary and the data type also may vary
e.g. input field-1 : string , input field-2 : choice, input field-3 : string,......input field-N :
These input fields meta data ( like name , data type etc.) are stored in a servicenow table as records so this can be pulled using query.
so how can i have the form like view with variable input fields where end user can provide input ? Is there any out of the box UI-component which can support this ?
- Labels:
-
Now Experience UI Framework

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2022 07:09 AM
You could use the repeater component to iterate over a data set, but I think you may run into issues when you need to render a field type dynamically. Essentially you'd need to add a component for each possible field type to the page, then show/hide them based on the piece of data you're iterating over.
Unfortunately, I'm not sure that approach is going to be great for performance so this may be a better candidate for something like service portal where you can script everything.
The other thing you could do is build your own custom component that takes in the data from your table and then displays the correct field type, but I don't have any examples for you on that one.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2022 12:38 AM
ok thanks