Some PDIs are currently unavailable, and PDI actions are paused. View the latest updates here. Read More

Custom Action Output Not Showing for Approval Record in Flow Designer

CHGNK
Tera Contributor

Hi everyone,

I’m working on a custom action in Flow Designer in ServiceNow where I’m trying to retrieve the Approver Name and Approval State from an Approval record.

Script used:

(function execute(inputs, outputs)

{
 var approvalrecord = inputs.ApprovalRecord;
 outputs.ApproverName = approvalrecord.approver.getDisplayValue(); outputs.ApprovalState = approvalrecord.state.getDisplayValue();

})(inputs, outputs);

Issue:

  • The script runs without any errors
  • Approvals are happening correctly on the Change Request
  • But in Execution Details, both ApproverName and ApprovalState outputs are coming empty

Context:

  • Input variable ApprovalRecord is mapped in the action
  • I’m triggering this from a flow related to Change Request approvals

Question:

Why are the output values not appearing even though the approval exists and the script executes successfully?
Am I accessing the Approval record incorrectly in Flow Designer?

Any suggestions or guidance would be really helpful.

Thanks!

2 REPLIES 2

CHGNK
Tera Contributor

Hi @Amit Gujarathi , I have followed the steps in your custom action video.
Could you please review this once?

 

CHGNK
Tera Contributor

Hi @Amit Gujarathi , I have followed the steps in your Custom action video.
Could please review it once?