Error: attempting to use undefined input = 'current' from "Catalog Item".

pardhiv
Tera Contributor

I have a flow designer that has a trigger "Service Catalog". I get the following error when I try to activate the flow.

Error:- Attempting to use undefined input = 'current' from "Catalog Item".
I confirmed that the following variable is present on the catalog.
 
var reqForLocation = fd_data.trigger.current.variables.requested_for.location.u_id;
 
Tried removing  variables there is similar field requested_for on RITM.
 
1 ACCEPTED SOLUTION

use this

var reqForLocation = fd_data.trigger.request_item.variables.requested_for.location.u_id;

Regards
Ankur

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

View solution in original post

8 REPLIES 8

Can I use it on Flow Designer ?

Ankur Bawiskar
Tera Patron
Tera Patron

@pardhiv 

whose location you are trying to get?

You should use Get Catalog Variables Action and then it would be easier for you

if you don't wish to use then update as this

I assume requested_for is reference variable to sys_user and location table has u_id field in it

var sysId = fd_data.trigger.current.sys_id;

var gr = new GlideRecord('sc_req_item');
gr.addQuery('sys_id', sysId);
gr.query();
if(gr.next()){
	var reqForLocation = gr.variables.requested_for.location.u_id;

}

Regards
Ankur

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

Same Error:-

attempting to use undefined input = 'current' from Investigate Hold

use this

var reqForLocation = fd_data.trigger.request_item.variables.requested_for.location.u_id;

Regards
Ankur

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