# Message to user only if something happens

**URL:** <https://forum.dynamobim.com/t/message-to-user-only-if-something-happens/67533>\
**Category:** Uncategorized\
**Created:** [August 25, 2021, 4:27pm UTC](https://forum.dynamobim.com/t/message-to-user-only-if-something-happens/67533 "2021-08-25T16:27:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mix](https://avatars.discourse-cdn.com/v4/letter/m/919ad9/32.png) [@mix](https://forum.dynamobim.com/u/mix)\
**Post date:** [August 25, 2021, 4:27pm UTC](https://forum.dynamobim.com/t/message-to-user-only-if-something-happens/67533/1 "2021-08-25T16:27:06Z")

</div>

Hi all, is there a way to add a message to the user “only if x happens”? I currently am using TaskDialog.show, and it is coming up no matter what. I would like a message to pop up only if say x=1 or whatever, or like only show up if I feed it a string, but not if I feed it an empty list. Something like that. Can someone point me in the right direction please?

---

<div class="post-metadata">

**Author:** ![Brendan\_Cassidy](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/brendan_cassidy/32/7685_2.png) [@Brendan\_Cassidy](https://forum.dynamobim.com/u/Brendan_Cassidy)\
**Post date:** [August 25, 2021, 4:48pm UTC](https://forum.dynamobim.com/t/message-to-user-only-if-something-happens/67533/2 "2021-08-25T16:48:17Z")

</div>

I would do this within a Python Node, and use a If or else statement to do this

Eg:

```auto
if isinstance(input, str):
	#do taskdialog.show
else:
	#do something else

```

---

<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:** [August 25, 2021, 4:48pm UTC](https://forum.dynamobim.com/t/message-to-user-only-if-something-happens/67533/3 "2021-08-25T16:48:32Z")

</div>

The Data-Shapes UI has a toggle for whether to run a UI component or not. Use that as the condition you want to trigger the message.

---

<div class="post-metadata">

**Author:** ![mix](https://avatars.discourse-cdn.com/v4/letter/m/919ad9/32.png) [@mix](https://forum.dynamobim.com/u/mix)\
**Post date:** [August 25, 2021, 10:47pm UTC](https://forum.dynamobim.com/t/message-to-user-only-if-something-happens/67533/4 "2021-08-25T22:47:38Z")

</div>

Thanks Brendan, could you be a little more specific, I am new to Python. Can I put an empty list into the else statement? Can I put taskdialog.show into the out put?

---

<div class="post-metadata">

**Author:** ![Brendan\_Cassidy](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/brendan_cassidy/32/7685_2.png) [@Brendan\_Cassidy](https://forum.dynamobim.com/u/Brendan_Cassidy)\
**Post date:** [September 3, 2021, 9:30am UTC](https://forum.dynamobim.com/t/message-to-user-only-if-something-happens/67533/5 "2021-09-03T09:30:47Z")

</div>

I would suggest you put the task where i indicated in the IF statement then it will only run if the IF statement is true, if you put it as a OUT outside of the IF statement then it will always run as before.

You can also not include the Else part if you do not want to and at the very end if you are not bothered about the python node out just add “OUT=0” on a new line at the very bottom.
