Skipping approval if variable is set to yes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @EarlH
A cleaner approach is to check whether approval is required, rather than whether it should be skipped. The flow would look like this:
- Get Catalog Variables (retrieve skipApproval).
- If skipApproval = No:
- Update the stage to Waiting for Approval.
- Ask for approval.
- Update the stage to Fulfillment.
- Create the Catalog Task (existing task).
This works as follows:
- If skipApproval = Yes, the flow skips the approval steps and proceeds directly to updating the stage to Fulfillment, then creates the catalog task.
- If skipApproval = No, the flow first updates the stage to Waiting for Approval and requests approval. After the request is approved, the flow exits the IF block and continues to update the stage to Fulfillment, then creates the catalog task.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @EarlH
What is the issue that you're facing by incorporating this into your flow? If "yes" then create task if "not yes" create approval and then create task.
If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.
Best regards
Anders
Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/