Update Catalog Variable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2022 02:02 AM
Hi guys,
I have a Flow Designer that, when somebody submit a Catalog Request, creates another Catalog Request automatically.
The problem is that i want to take the Variables from the first Catalog Request Item and use it to fill the second Catalog Request item Variables....
I read on the community and it seems like i have to create a Custom Action to Update Catalog Variables...
I tried creating a custom action with 2 inputs :
- Ritm (sc_req_item.sys_id) (sys id of the second request)
- Variable (sc_req_item.variables.scu_cid) (the variable value of the first request)
and then use a script like this
(function execute(inputs, outputs) {
var gr = new GlideRecord('sc_req_item');
gr.addQuery('sys_id', inputs.ritm);
gr.next();
gr.variables.scu_cid = inputs.variable;
gr.update();
I thought it was going to work... but the Item Variable in the second request is still blank...
The only thing that could be the problem for me is the Type of the Variable (Lookup Select Box) while in the action i set the variable "Variable" with type = Variables... i don't know
Can u help me? I can give you more information if you need it..
Thank you
- Labels:
-
Scripting and Coding
-
Team Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2022 02:30 AM
Hello Luca,
I believe you can use the [Submit Catalog Item Request] action to submit another Catalog Item. In my case I have Standard Laptop Catalog Item. I have copied the Standard Laptop Catalog Item to create another "Copy of Standard Laptop" catalog Item.
Now create you can create a flow on your 1st catalog Item
1. Use [Get Catalog Variables] action to get the catalog item variable ( in my case it is Standard Laptop)
2. You can then use the [Submit Catalog Item Request] action to submit another Catalog Item (in my case it is "Copy of Standard Laptop" Catalog Item) and pass the value Catalog Item variable fetched in step 1 to this new Catalog Item request.
To keep it simple I have copied the "Standard Laptop" catalog item so that the variable type is same and easy to create a flow.
Please mark this helpful/correct, if it answer your question.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2022 09:35 PM
Hello Luca,
If your question is answered could you please close this thread my marking the response as correct.
Thanks