Service Catalog Item rich text label populated with values obtained through Client Script

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2022 12:10 PM
We have a catch all catalog item and we are trying to get users to use the correct catalog item instead of using the catch all. We currently have rich text label field that displays a list of catalog items that could be used based on category selected. We want to automatically populate the info for each category with a client script. I don't need help with the script but I cannot seem to figure out how to change the html contents of the rich text label. Do I need to use another field type or is their a way to set the value of the html from the client script.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2022 12:35 PM
Hi,
You can use:
g_form.setLabelOf('<field>','<value>');
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2024 12:14 AM
Can we make this as a link?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2022 12:47 PM
Hi,
Unfortunately, it doesn't appear that you can script to change the rich text label field.
Using g_form.setLabelOf('field_name', 'field_value'); works with other labels, but not the rich text label.
You'd possibly want to review using an alternative solution where you create individual widgets (or UI Pages for standard UI) for what you want to show, and then use variable macros and set the widgets/UI Pages on those macros to determine which shows, etc.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2022 12:54 PM
I thought that might be the answer. My problem is I don't know how to set this up where the client script would change the UI page content. Would it just be a standard client script with updated content passed to the specific UI page?