Reload/ refresh catalog form when value changes from Yes to No
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2025 11:50 PM
Hi All,
I want to reload/ refresh catalog item form on sp when a field value changes from yes to no.
TIA!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2025 11:56 PM
Hi @Ankita9793
What is your business case here? If you refresh the browser, all unsaved changes will be lost, and the user will need to fill them out again
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2025 12:53 AM
what's your business requirement here?
I agree with what Atul has shared. what if user has filled the info?
You can do this
1) Whenever user changes value from Yes to No, show user a message to use "Save Draft" feature
2) then you can reload after user confirms
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
03-28-2025 02:32 AM
Use g_form.refresh(); in your client script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2025 04:56 AM
Create an onChange Client Script in the catalog item. If the field changes from Yes to No, use window.location.reload(); to refresh the form. To clear specific fields instead, use g_form.clearValue('your_field_name');. Save the script and test it in Service Portal.