- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-27-2023 09:12 PM
Hello Everyone,
I need a small requirement regarding workflow activities.
I have an custom table in which I create a field short description I want to mapped this field into sysapproval_approver table any field in the approval record.
Can anyone help me solving my problem.
Please check an attachment in the sysapproval_approver table first I want to submit record on custom table after the request is generate I have open the approval request I want changes in the given approval record field.
Thanks and Regards
Suyash
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-27-2023 10:27 PM
try this -> your update line should be within IF
var gr = new GlideRecord('sysapproval_approver');
gr.addQuery('document_id', current.sys_id).addOrCondition('sysapproval', current.sys_id);
gr.query();
if(gr.next()){
gr.u_short_description = current.u_short_description;
gr.update();
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-27-2023 09:23 PM
So short description on sysapproval_approver table should get populated from short description field of your custom table record?
if yes then you can add that logic from the place where you are adding the approval
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-27-2023 09:33 PM
Actually I wasn't able to run this query.
I create workflow please check the attachment I need 2 requirement in this activity.
1. Once the record is created ,approval(For any user or group) will be automatically generated . But it only showing requested while submitting the record.
2. Short description field value from the custom table are automatically mapped to corresponding fields in the approval record.
In the second requirement i run business rule, GlideRecord but unable to populate the field value.
My query is :-
var gr = new GlideRecord('sysapproval_approver');
gr.addQuery('document_id','88ba7a2297dbb550a976358e6253af04');
gr.query();
while(gr.next()){
gr.u_short_description = current.u_short_description;
}
gr.update();
I have send an attachment of my workflow,
Can you help me solving my doubt?
Thanks and Regards
Suyash
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-27-2023 10:27 PM
try this -> your update line should be within IF
var gr = new GlideRecord('sysapproval_approver');
gr.addQuery('document_id', current.sys_id).addOrCondition('sysapproval', current.sys_id);
gr.query();
if(gr.next()){
gr.u_short_description = current.u_short_description;
gr.update();
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader