- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-09-2016 11:52 AM
Could I achieve this with a client script? I created a string field on the approval form, but I need to figure out how to pass the text from the request to the approval form.
The variable on the item is a single line text variable named bms_program_name
The field on the approval is a string field named u_bms_program_name
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-09-2016 03:14 PM
Cynthia,
I have skimmed through your comments and noticed that you have only checked insert check-box on the business rule. You will have to check the update check-box too and add this script. It should work now
(function executeRule(current, previous /*null when async*/) {
var app = new GlideRecord('sysapproval_approver');
app.addQuery('sysapproval', current.sys_id);
app.query();
while (app.next()) {
app.u_bms_program_name = current.variables.bms_program_name;
app.update();
}
})(current, previous);
Thanks,
Abhinay
PS: Hit like, Helpful or Correct depending on the impact of the response

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-09-2016 03:06 PM
Cynthia,
can you attach a screen shot of the business rule conditions and script you have right now.
Thanks,
Abhinay
PS: Hit like, Helpful or Correct depending on the impact of the response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-09-2016 03:15 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-09-2016 03:14 PM
Cynthia,
I have skimmed through your comments and noticed that you have only checked insert check-box on the business rule. You will have to check the update check-box too and add this script. It should work now
(function executeRule(current, previous /*null when async*/) {
var app = new GlideRecord('sysapproval_approver');
app.addQuery('sysapproval', current.sys_id);
app.query();
while (app.next()) {
app.u_bms_program_name = current.variables.bms_program_name;
app.update();
}
})(current, previous);
Thanks,
Abhinay
PS: Hit like, Helpful or Correct depending on the impact of the response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-09-2016 03:17 PM
that worked! Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-09-2016 02:58 PM
Hi Cynthia,
Sorry to hear you're having troubles. This is one of those things if I was on your instance as a Technical Consultant I could bang out in about 10 minutes, but going back and forth on the community is a bit more challenging. I recommend reaching out to ServiceNow or one of our partners for a quick professional services engagement (or longer if you have other similar requirements) to see where they can help.