Expand my Community achievements bar.

Got questions about Workfront Governance? Join our upcoming Ask Me Anything session on February 12th!

Filtering out objects with Pending Approvals

Avatar

Level 6

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, 

Mylah_3-1732263360287.png      Mylah_0-1732261287423.png

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 :

Mylah_2-1732263024424.png

 

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

 

 

2 Replies

Avatar

Community Advisor

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.

Avatar

Level 6

Hi @Mylah 

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