How to Save and Reload UI Page Form Data in Read-Only Mode for Future Visits
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2025 09:55 PM
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:
-
A user fills in the form and submits it.
-
When the same user (or someone else) revisits the UI Page later, the previously submitted values should be automatically loaded and displayed.
-
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2025 10:44 PM
my response
-> I believe for retrieval you can run body onload function and see for the CHG if the data is already stored
-> Storing in CHG -> use GlideAjax call or GlideRecord in UI page client script to store data
-> making html element readonly - use html readonly attribute, for this you can check HTML W3 schools for other options.
I hope I have answered your question.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2025 10:51 PM
@Ankur Bawiskar ok let me work on it and will come back here for any queries till then i will keep this thread active.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2025 11:32 PM
@Ankur Bawiskar I am able to fetch the values from elements when they have ID using below code
var abc = gel('<sampleID>').value;
However, when I am doing the same thing for class it is not working. Do we separate methods for class elements ?
