Variables get duplicated when importing a Screen

I find the feature of saving a screen to “My Screens” super useful, often I want to try out a different strategy for some problem, and starting from something known is better than starting from scratch.

However, I often find myself in trouble as all app variables and imported features get doubled when I use the screen again.

Am I doing it all wrong?

How do you use this feature?

Henrik

1 Like

Yes. I posted this on github recently. Check it out here. It probably could use a better title

3 Likes

Hey @henrikhngj5 - I don’t think you’re doing this wrong, it sounds like it might be a bug on our end.

2 Likes

Thanks Domhnall,

It is driving me crazy as it dublicates all my invisible components, which in turn, when I delete the dublicates, invalidates all my screens, and I have to go searching for the errors everywhere.

This sparked a great idea, in my own humble opinion…, what if you could click the error icon with the number and auto scroll to next error? going through a long block sequence trying to see the warning sign is painful, and if you have to do it often…

Well , perhaps just an idea…

1 Like

Hi all.
Yes, variables are not deleted when you delete an specific function but at least you can delete them manually.

By the way, when re-using screens and blocks with “My Screens” can put in your project a couple of variables with same name but behind the variable name there is a unique id, so you just need to change the name to the first duplicated variable and you’ll see in blocks which one changes. :wink:

1 Like

I just ran into the same thing . I was so confused when suddenly I had lots of duplicates of my invisible components, but then I figured it was from copied screens and saw your post confirming it.
I actually don’t know if duplicates will have an impact and if so which one, i.e. on app performance. I did clean things up manually though by deleting duplicates and then finding and correcting errors in the blocks. This was slightly tedious, but from now on I can do this first thing every time I add a screen from the saved screens.

I have been having the same problem.
One of the workarounds I have used is just rename the invisible components when I add them for the first time. For example, if I add an Alert, the default name is usually Alert_1. I will change it to say, “Screen3Alert”. Now when I duplicate the screen, the duplicate alert is added as Alert_1 and I immediately know which ones to delete.