Good day all,
In my app I am scanning if any cloudDB data has changed and if so it downloads it to TinyDB onto the phone for faster startup next time. That all workd.
What I am hoping for that I can make a smarter solution for the following blocks:
I was thinking about something like this:
if the tag = (specific numeric value) then get cloudDB value and tinyDB store value. Then for the next one if it doesn't equal the MAX (which in this case is nr 60.) then add +1 to the previous number until the max of 60 is reached so I don't have to do this every time I add a new block.
I appreciate any help.
Thanks!
Use the DataChanged block ?
Well, It's not that I want it to only scan through when it is changed but everytime when the screen is initialized. To keep it short I want to compress the amount of block to something that does the same as seen above just with fewer blocks if this is possible so It scans "global name 1" Which is just "1" and uses that also as tag for the value, then it goes +1 so it equals 2 and so on until it reaches a set maximum like in this case 60. Is this possible?
Why not use lists, and save everything to one list in AI2, then that one list in the cloudDB, instead of 60 tags?
In your code, you are repeating your self
How would I get all tags to a list?
I believe I know how to save and retrieve the list from cloudDB, but lastly, how would I use the list to make it check each tag and save the value corresponding to that tag from the list and using this info to save each value/Base64 string (image) with the correct tag to the tinyDB from this list?
Use the for each item / number list blocks to iterate over the list for values, and then take action.
Learn about using lists:
General Tutorials