How to map a portal variable to a field in request

Jon M3
Tera Expert

I am trying to figure out how to take a variable on my Portal and map it to a field in a Request.

1 ACCEPTED SOLUTION

Add this to your workflow run script of Requested Item and it should work

var request = new GlideRecord('sc_request');

if (request.get(current.request)) {

request.requested_for = current.variables.u_requested_for;
request.short_description = current.variables.<your_variable_name>;
request.update();

}

 


Please mark this response as correct or helpful if it assisted you with your question.

View solution in original post

13 REPLIES 13

Can you post the script you used?


Please mark this response as correct or helpful if it assisted you with your question.

Jon M3
Tera Expert


var request = new GlideRecord('sc_request');

if (request.get(current.request)) {

request.requested_for = current.variables.u_requested_for;
request.short_description = current.variables.u_access_list;
request.update();

}

Ok . Cool. Confirm this workflow is running on Requested Item.


Please mark this response as correct or helpful if it assisted you with your question.

Jon M3
Tera Expert

As it turns out the issue is that it is putting to person who created the request in as Requested For and there is a separate field that holds that information.  They could be the same  person but a manager could put in a request for someone else and it is that persons name that I want to show in Requested For.  Sorry - my previous explanation was not clear.