How to Save and Reload UI Page Form Data in Read-Only Mode for Future Visits

bishalsharm
ServiceNow Employee
ServiceNow Employee

Hi Community,

I’m working on a UI Page for a change request form that contains multiple HTML elements such as:

  • TextArea

  • Label

  • Table

  • Checkbox

The use case is as follows:

  1. A user fills in the form and submits it.

  2. When the same user (or someone else) revisits the UI Page later, the previously submitted values should be automatically loaded and displayed.

  3. All form elements should appear in a read-only (non-editable) state on revisit if data already exists for that user.

How can I achieve this functionality ?

Any example or best practice guidance would be really helpful.

Thanks in advance!

 

-Bishal

7 REPLIES 7

Ankur Bawiskar
Tera Patron
Tera Patron

@bishalsharm 

share the UI page you created.

Remember to store the values already entered in the UI page you will have to store them somewhere in database.

where are you planning to store? in some CHG field which you can always hide in form

You can then check if the values were previous entered then make those HTML elements as readonly

If my response helped please mark it correct and helpful 👍 & close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

bishalsharm_1-1747287181588.jpegbishalsharm_2-1747287196043.jpegbishalsharm_3-1747287205459.jpeg

@Ankur Bawiskar well if i can store them in the same chg record then i dont need to create a custom table. and yes i can hide the fields. so answer is yes i will store them in chg record by creating appropriate fields.

@bishalsharm 

yes correct, please store in some hidden field of CHG and no custom table required.

Then you can retrieve and check and then auto populate it again.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur Bawiskar ok, but how do we retrieve the value from these different elements. 

can you share a sample script for below:

1. Retrieving the value from element

2. Storing it into same CHG record field

3. Making the element non editable if the field has value.