Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Approval field not being set as "requested" when manually approvals are created

Gaurav Vaze
Kilo Sage

Hello experts,
I am having one scenario where I'm using the approval field on demand form which is off course a task table field

when approvals are requested via flow/workflow this field correctly gets set to either requested/rejected/approved etc etc

but when users are creating the approvals mannually(ad hoc), then this field does not reflect correct status at all

why is this happening?

is there any OOB BR or process that sets the approval field to respected value?

if not then how can I solution this requirment, I know I can create a BR but is there any alterative available OOB(workflow activity wont help as we are using the flow and these approvals are being created manually)

 

I will appreciate any helpful info

Thank you!

Gaurav Vaze

ServiceNow Developer

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@Gaurav Vaze 

what do you mean by manually created approval records?

share some details.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Sure @Ankur Bawiskar 

Users are using edit button to add the user whom approval should go to from the approval related tab

GauravVaze_0-1763542596178.png

and then use the Request Approval button

it has following code:

current.state="requested";
current.update();
new ApprovalUserFeedback().requested(current);

this sets the state as requested for the added approval

 

This is how they are creating manual approvals as of now

 

What do you think about this, Thank you

 

@Gaurav Vaze 

yes it seems OOTB behavior as that code is not updating the parent task record for which approval is requested.

You can enhance that to update the approval field on the parent record.

But when you set approval using flow or workflow system takes care of updating the approval field on Demand or other task based record.

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader