We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

Skipping approval if variable is set to yes

EarlH
Tera Contributor

I have a flow that currently always asks for approvals.  I have a new requirement that if the variable skipApproval is set to Yes it should skip the approval stage and move to the fulfillment stage and create tasks.  I am trying to not create additional actions and use the ones that are already in place.  How can I do this?  I have an if statement created but cannot figure out how to skip to the steps where the fulfillment process begins.

1 REPLY 1

Vikram Reddy
Tera Guru

Hey @EarlH,

 

Nest the existing Ask for Approval action inside an If block, and leave your fulfillment/task-creation actions sitting after that If/Else logic block instead of inside it. That's the whole move, no need to touch or duplicate the fulfillment actions.

If: Trigger > Variables > skipApproval  is not  true
    -> Ask for Approval (existing action, unchanged)
Else:
    -> (leave empty)
[outside/after the If/Else block]
    -> Create Task action(s) (existing, unchanged)

This works because Flow Designer's If/Else logic block reconverges on its own once it finishes evaluating, unlike the old Workflow editor where every branch needs its own path drawn all the way to the end. Anything you place after the closing of the If/Else runs on both branches, whether the approval fired or got skipped. So one If gate wrapped around the approval step is enough, your fulfillment actions keep firing exactly as they do today, approved or skipped.

  • Yes/No variables don't always come back the same way. Depending on your release, Flow Designer hands you a real boolean (true/false) or the literal text yes/no for the same variable type, so check the actual pill value in a test run before locking in the If condition.
  • There's a system property, com.glide.hub.flow.catalog_variables.yes_no_as_boolean, that controls which format Get Catalog Variables and the trigger variables return. Worth a look if your condition seems to evaluate backwards.

 

Thank you,
Vikram Karety
Octigo Solutions INC