logo

NJP

Improving form load times / Restricting tables in script based forms (Business Rules, UI policies, Client Scripts etc.)

Import · Aug 28, 2022 · article

In case there is a performance issue with loading script based forms (Business Rules, UI policies etc.) due to a long list of tables or if there is a need to restrict tables displayed in such forms, the steps below can help.

1. Seen below is a UI policy on incident table. Expanding the Table field displays other tables in the system

image

2. To restrict the number of tables displayed, create a Script include, add a method named "process()", and have it return an array of table names. Note that it's important to have the method's name as "process"

image

3. Configure the dictionary of "table_name" type field (in this case, "Table" field on UI policy form) and add attribute "Table choices script" and set it to the Script include name above

image

4. Refresh the UI policy form and open the Table field to view the available choices

image

5. As seen above, the table names will be restricted to the names returned by Script include

Thanks,

Arav

View original source

https://www.servicenow.com/community/now-platform-articles/improving-form-load-times-restricting-tables-in-script-based/ta-p/2312800