The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Why the request for field is populated with the current login user

Alon Grod
Tera Expert

When I created a new catalog item request, the request for field of the sc_request table is populated automatically with the current login user instead of the taking the value from the request for variable. How can I make sure that this field will populate automatically with the request for variable from the catalog item. Again, Im talking about sc_request table.

20 REPLIES 20

@Ankur what do u mean by workflow run script? can I do it using BR?

@Alon Grod 

are you not having workflow or Flow for your catalog item?

If yes then you can add logic in it.

Why to create extra BR for this?

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

@Alon Grod 


Thank you for marking my response as helpful.

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

@Ankur Bawiskar @Prince Arora Im still getting the error, maybe its because of other BR? Should I share all the BR that related?

@Alon Grod 

I already shared the BR script yesterday

are you using the same?

you should use after insert on RITM

var ritm = new GlideRecord('sc_req_item'); 
ritm.addQuery('sys_id', current.sys_id); 
ritm.query(); 
if (ritm.next()) { 
	if (!JSUtil.nil(ritm.variables.requested_for)) { 
		ritm.requested_for = ritm.variables.requested_for;
		ritm.update();
	} 
}

 

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