How can i get value of catalog item variables in sc_req_item?

Jaeik Lee
Mega Sage

Hi. I used flow designer to send REST. 

One variable needs catalog item variable in RITM, and i used sc_item_option_mtom. but it failed. security policy block my flow. so i want other ways.

thank you for help.

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

why not use Get Catalog Variables action in flow and then use that variable in your REST step.

Also possibly the user in whose session the flow is running doesn't have read access to table "sc_item_option_mtom"

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Reason of not use Get Catalog Item is I need dynamic value. 

I want value of catalog item  in sc_req_item. But Get Catalog Variables can't do it. 

Have you any way to find dynamic value using Get Catalog Variables? 

If you have, Please teach me. 

Hi,

You can use Custom Action as script in the Flow and then query RITM again and fetch the latest value

That custom action will have 1 input variable i.e. RITM sysId and 1 output variable

Custom Action in ServiceNow Flow Designer

Something like this and then use output of this custom action in your next steps

(function execute(inputs, outputs) {
	var ritmRec = new GlideRecord('sc_req_item');
	ritmRec.get(inputs.sysId);
	outputs.variableValue = ritmRec.variables.variableName;
	
	// OR
	
	// you can also query sc_item_option_mtom table with the RITM sysId and fetch the variable value and set in that output variable
	
})(inputs, outputs);

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader