So I feel like this is maybe a beginner question, ...
# suiteflow
j
So I feel like this is maybe a beginner question, but reveals a weakness in my understanding of Workflows. I have a Workflow that adds a button which when clicked transitions to the next state of the WF to run a custom action. Then, it should exit the Workflow. The button should only show for certain people. I don't even want the WF running at all for anyone else. Let's say the only person who will use the button is "Sally". She is the only person that the WF should ever run for. The problem is, say Sally accesses the record, but doesn't click the button. Now if someone else goes to the record, the button will show for them as well. How do I make the Workflow exit every time, regardless of whether or not the button is clicked?
a
@jen I typically will add a condition to the Add Button action to restrict showing it by user. You can add it to the Workflow condition as well if you don't want it to initiate for anyone besides Sally. I think once a workflow is initiated with the basic WF-level conditions, it will remain in whatever state it enters into until it exits or transitions out. Not sure if this helps since it doesn't specifically address your question about existing, but adding the conditions in both places should achieve the desired result, I would think?
j
@al3xicon thanks for your response. This is what I have right now (I have the condition on both). It just seems overly complicated. I often have WFs with lots of buttons, so I'd have to add (and keep updating, potentially) the conditions in many places.
It seems odd that there's not some way to just be like "don't do any of these unless <condition>"
a
yeah, i agree
j
or perhaps there needs to be a built in action that is "exit workflow"
a
i suppose you could enter into an initial state and immediately transition to the state that adds the button, but only if user = sally? otherwise transition to a different state with no actions (which should cause it to exit)?
j
I'm actually trying the latter right now
🙂
a
still messy but if you have multiple actions in the wf it may be the preferred approach
right on, interesting to think about this stuff and the notion of not exiting a state may actually help me w/ something else right now
j
lol
I just want to avoid leaving button debris all over the place
whereas you're like "how do I leave delicious treats for others"
a
button debris...love it
j
oh man we have SO MANY BUTTONS
I wish there was a way to put them all in a dropdown
a
yeah there's a lot left desired by wfs for sure, yet often they're the most powerful option available for us 😕
j
They are great for certain things for sure, I just find them a bit of a black box as far as knowing what's actually going on (and debugging)