- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2017 12:53 PM
Hello team!
I needo to insert a value (string) from a catalog Item variable to a specific field on the table sc_req_item:
target table: sc_req_item
target field: u_oficina_afectada
source variable name: Oficina_afectada
Variable Type: reference
Refers to: cmn_building.
Should it go as a calculated field? Is it a script running as part of the workflow??
Can you please indicate me the exact steps should I follow to make it work?
Thank you!!!
Regards,
Pablo
Solved! Go to Solution.
- Labels:
-
Service Catalog
-
Workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2017 02:14 PM
Pablo,
You could achieve this with one of two methods:
- A 'before' business rule on sc_req_item. Note: you should consider adding a condition for the script to execute based on the specific catalog item(s) your variables are associated with. Basically, you don't want the business rule script to execute on every sc_req_item record because not all of them will have the same variables.
- A Run Script activity in whatever workflow is associated with that catalog item.
The fundamental components for the script would look similar to this:
current.u_oficina_afectada = current.variables.Oficina_afectada;
I hope this helps.
Cheers,
Jeff

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2017 04:20 PM
Variable is reference field type so use below.
current.u_oficina_afectada = current.variables.Oficina_afectada.getDisplayValue();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-09-2017 06:18 AM
Thenk you Deepak!! That worked fine!!
Best regards,
Pablo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-27-2020 07:55 AM
Thanks Jeff. Found this when faced with the same challenge. I used the Run Script suggestion in my workflow and it worked like a charm. Now I need to add the check if that variable exists in the catalog item and ignore the field assignment script if not.