Filtering out objects with Pending Approvals | Community
Skip to main content
Level 4
November 22, 2024
Solved

Filtering out objects with Pending Approvals

  • November 22, 2024
  • 2 replies
  • 588 views

One of our scenarios stopped today just before the Workfront Update Record module because the record was an OPTASK with a status of New+Pending Approval. 

 

This is a very rare condition, so to avoid this happening again I modified the scenario to stop for any object where there is an Approval Process with a status of Pending Approval. 

 

Here is what I did:

 

Using a Read Record module, I read the awaitingApprovals collection for the object, 

      

And just after that module, I created

--- a variable representing the numeric length of the array  (I did it this way because I've had problems with 0 and 1 being recognized as strings and not numeric data types in the past)

--- then a filter for the route to continue only if the variable is less than 1 :

 

This approach works after testing, but was there a simpler way to do this?  Thanks for your feedback.

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Sven-iX

Hi @mylah_d 

The only simplification i can think of is to use the length() function in fusion.

 

On the filter you could say 

 

length( { the approvals array from the readRecord module } )

Numeric: equals

0 (zero)

-----

Or, use the status value:

 

Check the module that gets the event: You can filter for status not-equals NEW:A  INP:A etc Where ":A" signifies pending approval. 

Otherwise in your filter you can say

status 

doesn't contains

:A

 

 

 

2 replies

Kurt_Jones
Community Advisor
Community Advisor
November 22, 2024

Mylah,

This seems about as simple as Adobe makes it.  The approvals are designed to stop things from progressing in WF until complete which is likely why there is not a straight-forward path to get around with Fusion either.

Sven-iX
Community Advisor
Sven-iXCommunity AdvisorAccepted solution
Community Advisor
November 22, 2024

Hi @mylah_d 

The only simplification i can think of is to use the length() function in fusion.

 

On the filter you could say 

 

length( { the approvals array from the readRecord module } )

Numeric: equals

0 (zero)

-----

Or, use the status value:

 

Check the module that gets the event: You can filter for status not-equals NEW:A  INP:A etc Where ":A" signifies pending approval. 

Otherwise in your filter you can say

status 

doesn't contains

:A