# Two work flow paths depending on user response

**URL:** <https://forum.dynamobim.com/t/two-work-flow-paths-depending-on-user-response/20911>\
**Category:** Revit\
**Created:** [April 10, 2018, 6:15pm UTC](https://forum.dynamobim.com/t/two-work-flow-paths-depending-on-user-response/20911 "2018-04-10T18:15:50Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![BBDCW](https://avatars.discourse-cdn.com/v4/letter/b/e8c25b/32.png) [@BBDCW](https://forum.dynamobim.com/u/BBDCW)\
**Post date:** [April 10, 2018, 6:15pm UTC](https://forum.dynamobim.com/t/two-work-flow-paths-depending-on-user-response/20911/1 "2018-04-10T18:15:50Z")

</div>

I have a python script, a code block, and a boolean. If the boolean (door has hardware) is true then i dialog pops up in Revit saying “HAS Hardware”. If the boolean (door has hardware) is false the dialog does not appear. This is behaving correctly. What I’m trying to do next is to have two different work flows. One for each response to each boolean (true or false). Sounds like I need an if statement but nothing I try works. Any help out there?

Thanks!

![Capture](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/d/8/d841a3ba2545a51c0ef81c24703cb7271430ff8a.PNG)

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [April 10, 2018, 6:38pm UTC](https://forum.dynamobim.com/t/two-work-flow-paths-depending-on-user-response/20911/2 "2018-04-10T18:38:15Z")

</div>

You already have everything set up. Just insert your workflow under the `if` or `else` results respectively.

---

<div class="post-metadata">

**Author:** ![BBDCW](https://avatars.discourse-cdn.com/v4/letter/b/e8c25b/32.png) [@BBDCW](https://forum.dynamobim.com/u/BBDCW)\
**Post date:** [April 10, 2018, 6:46pm UTC](https://forum.dynamobim.com/t/two-work-flow-paths-depending-on-user-response/20911/3 "2018-04-10T18:46:18Z")

</div>

Oops. I should have been more clear sorry. I don’t know python very well. I was just looking for a way to introduce a dialog box and thats what I came up with. The rest needs to be dynamo nodes. I have a complete graph but don’t want it to run unless the boolean is false.

 ![Capture](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/c/ac2f55485481a11937477537aed8a1e2288fa31e.PNG)

---

<div class="post-metadata">

**Author:** ![BBDCW](https://avatars.discourse-cdn.com/v4/letter/b/e8c25b/32.png) [@BBDCW](https://forum.dynamobim.com/u/BBDCW)\
**Post date:** [April 10, 2018, 6:56pm UTC](https://forum.dynamobim.com/t/two-work-flow-paths-depending-on-user-response/20911/4 "2018-04-10T18:56:31Z")

</div>

To further clarify… If true run a workflow if false exit graph is really what I’m trying to do.

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [April 10, 2018, 6:59pm UTC](https://forum.dynamobim.com/t/two-work-flow-paths-depending-on-user-response/20911/5 "2018-04-10T18:59:57Z")

</div>

You can’t have a function as a Python input. Is that what you’re looking to do?  
You might have some better luck if you wrapped your workflow into a custom node or possibly a single code block.

---

<div class="post-metadata">

**Author:** ![BBDCW](https://avatars.discourse-cdn.com/v4/letter/b/e8c25b/32.png) [@BBDCW](https://forum.dynamobim.com/u/BBDCW)\
**Post date:** [April 10, 2018, 7:03pm UTC](https://forum.dynamobim.com/t/two-work-flow-paths-depending-on-user-response/20911/6 "2018-04-10T19:03:54Z")

</div>

Doesn’t necessarily need to be python at all. It was the only way I could find to display a dialog box. Looking for a way to ask a user a T/F question and have the work flow use a series of nodes based on their answer. True do this, false do that…

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [April 10, 2018, 7:06pm UTC](https://forum.dynamobim.com/t/two-work-flow-paths-depending-on-user-response/20911/7 "2018-04-10T19:06:31Z")

</div>

Try ScopeIf. It works best inside a custom node. (Sometimes it breaks in a .dyn) ScopeIf will only execute the preceding function of the test boolean.

---

<div class="post-metadata">

**Author:** ![BBDCW](https://avatars.discourse-cdn.com/v4/letter/b/e8c25b/32.png) [@BBDCW](https://forum.dynamobim.com/u/BBDCW)\
**Post date:** [April 10, 2018, 7:16pm UTC](https://forum.dynamobim.com/t/two-work-flow-paths-depending-on-user-response/20911/8 "2018-04-10T19:16:46Z")

</div>

Thanks. Will do. Is there a way to present the user with a dialog box? Something along these lines… If boolean is true display dialog box telling the user that the command (graph) is exiting, if false will continue?

---

<div class="post-metadata">

**Author:** ![BBDCW](https://avatars.discourse-cdn.com/v4/letter/b/e8c25b/32.png) [@BBDCW](https://forum.dynamobim.com/u/BBDCW)\
**Post date:** [April 10, 2018, 7:21pm UTC](https://forum.dynamobim.com/t/two-work-flow-paths-depending-on-user-response/20911/9 "2018-04-10T19:21:30Z")

</div>

> “You might have some better luck if you wrapped your workflow into a custom node or possibly a single code block.”

Hmmm… Pretty new to dynamo. Not sure how to do that.

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [April 10, 2018, 7:26pm UTC](https://forum.dynamobim.com/t/two-work-flow-paths-depending-on-user-response/20911/10 "2018-04-10T19:26:15Z")

</div>

Python or other custom nodes are options for dialog boxes. Data-Shapes and Rhythm are two good packages to start with.

I’d also highly suggest you go through the Dynamo Primer to learn these things first. It’s hard to develop a complex workflow if you don’t know the basics.

---

<div class="post-metadata">

**Author:** ![BBDCW](https://avatars.discourse-cdn.com/v4/letter/b/e8c25b/32.png) [@BBDCW](https://forum.dynamobim.com/u/BBDCW)\
**Post date:** [April 10, 2018, 7:40pm UTC](https://forum.dynamobim.com/t/two-work-flow-paths-depending-on-user-response/20911/11 "2018-04-10T19:40:19Z")

</div>

> “I’d also highly suggest you go through the Dynamo Primer to learn these things first. It’s hard to develop a complex workflow if you don’t know the basics.”

Thanks. Will do. Good advice. I’ve got a lot of experience with LISP, VB, [VB.NET](http://VB.NET) and VBA. I’ve also had success with other dynamo graphs but need user interaction with this one.

If I understand you correctly… There’s no way to use the python script I have and run two different work flows (nodes) based on the user’s response to the dialog box that python is creating. Correct?

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [April 10, 2018, 7:47pm UTC](https://forum.dynamobim.com/t/two-work-flow-paths-depending-on-user-response/20911/12 "2018-04-10T19:47:56Z")

</div>

> [@BBDCW](#):
>
> I’ve got a lot of experience with LISP, VB, [VB.NET](http://VB.NET) and VBA.

I would urge you to learn Python. It will make things much easier for you.

> [@BBDCW](#):
>
> There’s no way to use the python script I have and run two different work flows (nodes) based on the user’s response to the dialog box that python is creating. Correct?

I don’t want to say it’s _not_ possible, but it would be **a lot** easier to do it all within the Python node. You might be able to get it to work with a ScopeIf or you could try changing the inputs to your workflow instead of changing what gets run.

---

<div class="post-metadata">

**Author:** ![BBDCW](https://avatars.discourse-cdn.com/v4/letter/b/e8c25b/32.png) [@BBDCW](https://forum.dynamobim.com/u/BBDCW)\
**Post date:** [April 10, 2018, 7:50pm UTC](https://forum.dynamobim.com/t/two-work-flow-paths-depending-on-user-response/20911/13 "2018-04-10T19:50:01Z")

</div>

Ok. Thanks for all your time! What’s your estimate on the learning curve for Python?

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [April 10, 2018, 7:52pm UTC](https://forum.dynamobim.com/t/two-work-flow-paths-depending-on-user-response/20911/14 "2018-04-10T19:52:59Z")

</div>

Python is very user friendly. Since you have programming experience already, everything should be familiar. I would think you’d merely have to break a few old habits and get used to the new syntax. Should take hardly any time at all before you’re up and running.

---

<div class="post-metadata">

**Author:** ![BBDCW](https://avatars.discourse-cdn.com/v4/letter/b/e8c25b/32.png) [@BBDCW](https://forum.dynamobim.com/u/BBDCW)\
**Post date:** [April 10, 2018, 7:53pm UTC](https://forum.dynamobim.com/t/two-work-flow-paths-depending-on-user-response/20911/15 "2018-04-10T19:53:46Z")

</div>

Great. Thanks again!
