This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Sub workflow triggered by field value chosen

Hello,

We have a simple checklist created and I've been asked if we can have a Yes/No field added and if the user chooses Yes, it kicks off a sub workflow (checklist) that then sends a notification to the relevant people this new sub workflow needs their attention.

I know sub workflows are possible but can they be "activated" only if a particular value is chosen in a particular field?

Thanks,

Mike

  • Suggested Answer

    0  

    Hi Mike,

    To kick off the sub-workflow, you would need to do a "post" or a "sub task" transition to create an item in that sub workflow. Then, that sub workflow would need the notification that goes to the relevant people. The trick is how to run the post or sub task transition.

    The easiest way would be to have transition button on a state form for the user to click. So, instead of a yes/no field, they would click the button to start the sub-workflow process, so not click it. 

    Another option would be to use a decision. The decision would have a rule that checks the yes/no value. If no sub-workflow is needed, a normal transition would go to the next state. If a sub-workflow is needed, a Post or Subtask transition would go to the next state. (I have not actually tried this, but logically, it should work.) It would look something like this:

    The only other option I can think of is to write an appscript (or modscript) to check the value and run the subtask transition. 

    I hope that helps.

    Vickie

  • 0  

    The workflow gets assigned to the project.  Is the intent for this project to be in a different project.  If the Yes/No field is checked on the submit / first state, it can set the project to the project with the sub-workflow.  Or is this more of a subtask that is being created as is suggested by Vickie's response?

  • 0 in reply to   

    Vicki and David,

    Thanks very much for taking the time.  I got tied up with other things for a bit but now I am back at this.

    The existing workflow is actually just a checklist with a list of tasks.  Each task has a drop down with two options: NA and Complete.  Somewhere in there they want to add a Yes/No question and if the answer is Yes, that will kick off a new workflow which would be just another checklist.  A No answer will do nothing and the existing checklist will continue normally.

    This question needs to be a required field so we make the user answer it.

    I'm wondering if it's possible to have these additional questions included in the original checklist but hidden.  If the user answers the question Yes, then the additional questions become visible?  Just trying to think of some options.

    In the meantime I think I will look into the "decision" option.  I'm sure I'll be back on here with more questions!

    Thanks,

    Mike

  • 0 in reply to 

    The Decision is the way I'd do it.

    Making questions visible (or invisible) on a form is easy with Form Actions (or JavaScript).  When the "Yes/No" changes to Yes then then the Form Action makes questions visible (and optionally required).  If the "Yes/No" changes to "No" then the Form Action hides the questions (and optionally makes then not-required).