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

Jon M3
Tera Expert

Also - my field is named u_requested_for

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.

Jon M3
Tera Expert

Do I put a Run Script activity in the workflow and add the code there?  That is what I tried and it doesnt seem to be working/

find_real_file.png

Add Run Script after Begin


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

Jon M3
Tera Expert

That is where I had it to start - same results