Unidentified variable in dynamic component

I have a “Users can edit as text box” option in a dynamic component assigned to a variable optionVar. But if the user deletes the text from the text box and clicks on Apply, the optionVar becomes undefined and any operation that uses it becomes an error (red hashtag). For example, these cause errors if the user deletes the text, but the errors disappear if the user enters any text at all:

myVar =IF(LEN(optionVar)=0, “My Default String”, optionVar)
myValue =CURRENT(“optionVar”)

So, I need something like ISDEFINED(optionVar). Any ideas?

Does myVar=IF(optionVar,optionVar, “Defaultstring” ) work?

No. If the user clears the text out of the options text box for optionVar, your code induces a red hashtag error.

yes this is true,
It requires some input, so unless the developers resolve this, a default similar to the inbuilt attributes, then you need to educate all users to enter data, as leaving “blank” is unacceptable. I would agree its a bug.

Hi, I’m going to make your answer the solution although it isn’t too satisfying :slight_smile:

I sense that DCs are low priority on the dev team’s list.

According to this SketchUp talk, one of the developers might be around… @psaal
[Season 3, Episode 5] SketchUp Talk: Online product catalogs with Peter Saal

1 Like

I rather not have it as a solution, the solution would either be a revamp of DCs or have a more worthy replacement. If the latter, given the fact DCs have survived 10 years without much development,(in software terms its almost unheard of) I believe they will still be around for a while. Hopefully any new development will respect (possibly convert) the old.

1 Like