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

SanjivMeher
Kilo Patron
Kilo Patron

What kind of catalog is it? You mayn't be able to map it to request, but you can map it to field in requested item in its workflow


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

Jon M3
Tera Expert

It is in the service catalog.  I have a User variable that I was to map to the Requested For field for the request that is generated.

If you have a variable requested_for, it should automatically map to Request's requested for


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

Jon M3
Tera Expert

But the variable has to be named requested_for?   Also - what if I want data from the form to go into Short Description?