Providing default value for non-persistent bindings

I know I can set a property to persistent in order to cause a default value to show up, but when the property is the result of a binding, it will end up being whatever the bound value happens to be when I save the project. At one point I thought I learned that a default for non-persistent values could be set by wrapping the binding in coalesce:

coalesce({someBoundValue}, 'defaultValue')

...but that does not appear to be working. I still see the value I saved in development appearing before the live values populate. Is setting a property to persistent the only way to ensure initial display of a default value before a binding is evaluated?

coalesce() replaces a null with a default. Non-persistent properties start as null. You have to use coalesce() in all expressions that reference the non-persistent property.

2 Likes

That's what I thought, but... I have a custom property on the view:

...then a label visibility binding on that:


The label is visible when first loading the view.

That {view.custom.tagPathBase} parameter on the first binding is also non-persistent. It's the result of a runScript expression that references a view parameter. The label still appears even if I wrap that in a coalesce.

Get rid of the transform. They have latency. Put the coalesce on the label's visibility expression. (And set that visible prop to non-persistent.)

That doesn't fix it, the label still shows. I had only added it hoping to fix the problem.

Unless I'm misunderstanding, that's already what I had (my second screenshot).

You need both the custom prop and the visible prop to be non-persistent.

They are:


Hmm. Stumped.