App has slowed to a crawl

Good day. Well, this is disappointing. My app has slowed to a crawl and it literally takes 4 minutes to make a change to a block. What can I do to alleviate this?

I have currently 21 switches in the app and I plan on adding a lot more switches and features. At this pace I will finish by the end of this year.

Any help would be greatly appreciated.

Hi @bobbyj12, happy new year! :tada:

I responded to your question about switches yesterday with this sample app that I built for you, did you get a chance to look at it?

You should be able to refactor your app with the Any Component blocks to dramatically reduce your block count.

Just out of curiosity, what sort of app pare you building that requires so many switches?

1 Like

Thanks, @domhnallohanlon for helping. I did look at it and it am still having problems. My app is a checklist of this to do. There will about 5 categories and each category will have 15 to 25 items in the list. Each item with have a switch so the person knows if they did the work. I’m able to use the Any Component for switches to add the value to the real time database but I am unable to retrieve it and display the value on the switch (i.e. Switch is on, The tint is red, the thumb is green.) When I open the app, app switches are off and grey. I have been rattling my brain on this for a while. I’m its a simple fix that I just cant figure out.

Here is a screen print of the user facing page

Aha - that makes sense.

What a great idea for an app.

Can I recommend that you use a cloud variable instead though?

That looks easy. I put these block together but still get the same result. Any suggestions PLease?

Here is the screen

I think I might have cracked the code. When I save the value of a switch to Real time db, the input does not say “Switch1”. The field is a long combination of number and letters. If I change the “Any Switch” block from “Component” to “Switch1” if works perfectly. Somehow, I need to work around this so I don’t have blocks for each switch.
See attached.


Why make a set of switches if you can make a list with checkboxes?

See scrLists in