Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Add dynamically fields in a form.

ayordanov
Kilo Contributor

I want to make a form that has a dynamic number of fields, but the same (strings). There will be "+" button which adds a field, till the user doesn't need anymore. Something like the filter and its "and", "or" buttons. Is it possible and what workarounds has this problem?

1 ACCEPTED SOLUTION

Any of these will work


Client scripts, UI macros, UI pages



If you want the whole page to be custom then UI Page, if just part then UI Macro or Client Script.   It all depends on what the over all goal is and that will dictate the how.


View solution in original post

6 REPLIES 6

arnie
Mega Contributor

Assuming you have a max limit to the repeating fields (say 10), an easier way that is NOT dynamic would be to have 10*fields created on your form and then display them using a drop down that contains number of rows you want on the screen. All you need would be a set of UI policies to display the respective fields/rows on the form to show the rows based on the value selcted in the drop down. Otherwise I second Drew.


Julian Hoch
ServiceNow Employee
ServiceNow Employee

Yes, I created a small utility that does exactly that automatically for you:


ServiceNow Share