how to save a catalog item value into a table form field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-21-2022 11:50 PM
I have a requirement where I need to get values like description, category from my catalog item and save it in request (sc_request) form.
I tried writing a business rule for description field but I'm unable to pass values to the business rule from a catalog item.
Can anyone help me pass both description and category values.
screenshots:
Thank You.
- Labels:
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-22-2022 12:28 AM
You need an After insert business rule on RITM (sc_req_item) table with below code.
(function executeRule(current, previous /*null when async*/ ) {
var reqis = new GlideRecord('sc_request');
reqis.addQuery('sys_id', current.request);
reqis.query();
if (reqis.next()) {
reqis.description = current.variables.description1; //replace description1 with correct description variable name
reqis.short_description = current.variables.category; //replace category with correct category variable name;
reqis.update();
}
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-22-2022 12:44 AM
no it is still not working
the fields are not showing any value (not even false or undefined) in both (sc_request) and (sc_request_item)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-22-2022 12:45 AM
Did you replace correct variables above?
Can you share business rule conditions & screenshot. Apply logs for a check & confirm what you get in logs.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-22-2022 12:55 AM