How to Populate short description field value of any custom table to any field of approval record.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-26-2023 08:22 AM
Hello Everyone,
While working on workflow I was stuck.
I need two requirement to fulfilled :-
1. How to generate Approved request while submitting the record, when I was submitting my it was Requested!
2. I have an custom table in which a field name is u_short_description I want to mapped the field to corresponding to any field in the approval record (Inside the sysapproval_approve record).
Thanks and Regards,
Suyash
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-26-2023 09:40 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-26-2023 09:44 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-26-2023 09:54 PM
Hello @Suyash Joshi,
As you have use the 'Approval - User' activity in your workflow, so that's why it is setting the Approval status is 'Requested'. It is waiting for the approval to be approved.
Please refer to below screenshot to update the workflow.
If the above solution resolve your issue, please mark the solution as 'Accepted Solution' and also mark it as 'Helpful'.
Thank you!
Prathamesh.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-26-2023 09:47 PM
Hello @Prathamesh G
Can you check the GlideRecord query?
var gr = new GlideRecord('sysapproval_approver');
gr.addQuery('sys_id','88ba7a2297dbb550a976358e6253af04');(sysid of custom table)
gr.query();
while(gr.next()){
gr.u_short_description = current.u_short_description;
}
gr.update();

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-26-2023 10:01 PM
Hi your script should be like below:
var gr = new GlideRecord('sysapproval_approver');
gr.addQuery('document_id','88ba7a2297dbb550a976358e6253af04'); // you can use current.sys_id to make it dynamic in your workflow
gr.query();
while(gr.next()){
gr.u_short_description = current.u_short_description;
}
gr.update();
If your requirement is to update approval record with sys_id as soon as it is inserted/created then create Business Rule and update short description from the Approving record.
Make sure to put correct when to run condition so that it will only run for your custom table.
Thanks
Anil Lande