# Default Value for Optional Node Inputs

**URL:** <https://forum.dynamobim.com/t/default-value-for-optional-node-inputs/57606>\
**Category:** Developers\
**Tags:** improvement\
**Created:** [November 23, 2020, 8:42pm UTC](https://forum.dynamobim.com/t/default-value-for-optional-node-inputs/57606 "2020-11-23T20:42:25Z")\
**Posts on this page:** 5\
**Page:** 1

<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:** [November 23, 2020, 8:42pm UTC](https://forum.dynamobim.com/t/default-value-for-optional-node-inputs/57606/1 "2020-11-23T20:42:25Z")

</div>

Wanted to throw this out there to see if I’m just missing something or if others are running into the same issue. Request on GitHub can be seen [here](https://github.com/DynamoDS/Dynamo/issues/11275).

Basically, when packages are updated and existing nodes get additional optional inputs, graphs with these existing nodes do not update with Use Default Value turned on. This ends up causing the updated node not to run and the graph to fail.

How do the rest of you get around this? Are you manually updating your node input settings for each graph after every package upgrade?

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [November 23, 2020, 11:45pm UTC](https://forum.dynamobim.com/t/default-value-for-optional-node-inputs/57606/2 "2020-11-23T23:45:28Z")

</div>

> [@Nick\_Boyts](#):
>
> Are you manually updating your node input settings for each graph after every package upgrade?

That’s what I’d do. Setting graphs to use the default input on upgrade could cause errors which wouldn’t be exposed until it’s too late. A failure at least makes a human look at it and decide if that is the value the graph should use.

---

<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:** [November 24, 2020, 2:43pm UTC](https://forum.dynamobim.com/t/default-value-for-optional-node-inputs/57606/3 "2020-11-24T14:43:01Z")

</div>

I agree that there is the potential to introduce unseen issues, but to me, that’s just poor node design. If an input is truly optional then not using the input should do… nothing. Not using the optional input _should_ be the same as not even having that input. So it really shouldn’t be any different. There may be some valid scenarios where this isn’t the case, but I don’t think I’ve ever come across any.

My next question would be: Is this tradeoff reasonable? Is manually updating all placed nodes in all graphs worth avoiding a potential issue with a potentially problematic node?

Maybe a better solution is an option to automatically set the Use Default Value state for all nodes in a graph. That way you’re consciously making the decision to move forward, but at least not having to do it one by one. Thoughts?

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [November 24, 2020, 2:53pm UTC](https://forum.dynamobim.com/t/default-value-for-optional-node-inputs/57606/4 "2020-11-24T14:53:06Z")

</div>

> [@Nick\_Boyts](#):
>
> Maybe a better solution is an option to automatically set the Use Default Value state for all nodes in a graph.

I believe this is possible now by editing the dyn in textural format, but something I would still caution against, and would still require a review of ‘why’, which for the frequency this occurs (maybe 1x a year) isn’t something I would stress over. Far more often the new input doesn’t have a default value and you have to manually provide one.

Do you have an example node where in package version n there isn’t an input, but in n+1 there is which I can play with?

---

<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:** [November 24, 2020, 3:40pm UTC](https://forum.dynamobim.com/t/default-value-for-optional-node-inputs/57606/5 "2020-11-24T15:40:07Z")

</div>

It happens with Data-Shapes a lot with things like optional window sizing, sorting, or other toggles. All good things that I’m happy to have, but don’t necessarily want to have to set in all my graphs right away.

I most recently noticed it with the `Sorted_optional` input on `UI.DropDown Data` in 2019.2.49 but I’m afraid I don’t know which version I was on previously.
