Auto-populated variable in catalog item won't allow a field message
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2025 04:50 AM
On a catalog item, I have a URL type variable (Field B) which auto-populates using the functionality within the variable as follows:
Dependent question - "FieldA"
Reference - "cmdb_table_notrelevant"
Dot walk path - "fieldontable"
The requirement is to have the help text of Field B dynamically alter based on the chosen option in Field A.
I thought to do this via on onChange Client Script tied to Field A. After having looked into it I have found that you cannot manipulate help text via scripting, so I decided to instead delete the help text on Field B and replicate it using g_form.setFieldMessage(). The problem is that whilst the auto-populate is populating Field B from the choice chosen in Field A via the auto-populate, my client script is being overwritten, meaning I cannot set a field message (I have tried g_form.clearValue(), this did not work).
The only option I could think of was to potentially auto-populate the field as part of my client script? If anyone has a better solution to this it would be much appreciated, many thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2025 05:21 AM
yes please use onChange client script + GlideAjax to populate and also use logic.
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
07-09-2025 12:06 PM
Hello @Jake McC,
I have a better way I think which could help you which is please create the Onchange Client script for the (Field B) and use it like this based on your condition and value dynamically by using if and else as required.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Thanks and Regards,
Muskan