How to solve global initialize error and error fetching contents in tinydb?

i have problem in initialize global and tinydb , before i use dynamic component and it run after i add some new block and initialize global new i have error here i want to add photo and save it in tinydb and call it again when screen3 is opened


*the red mark is the new block I added


above is the error that appears when I press add it should be stored in the profile variable not in the imagelist


when screen 3 is re-opened it appears like that
please help me what should i fix, thanks

Because of this logical fault you rreceived the error

In screen inti you are storing the last item of tinydb in global id but on button click you are trying to add intiger to the list item. How will it work?? :thinking: :thinking: :thinking:

thanks for helping maybe i am wrong in thinking i need to keep learning on this what should i change?

but it worked to add my dynamic component but when i add new inizialise global and tinydb value with different topic the problem comes back


:grimacing: :tired_face:

i think you are trying to take the total length of the tinydb tags. if so why do you take the last item of tinydb?
just try with

set global id to length of the list call tinydb tags

so next time while you click plus button, global id will turn to (imagine if there are 10 tags in tinydb) 11 and the item will be added to dynamic component without error

I understand what you mean but it’s difficult for me to implement in my block, I have tried it several times please help me
Dynamctest2_1.aia (291.6 KB)

i meant like this

Just modify and test

also just change like this too and test

@Moh_khafil_albab

I have tested the first suggestion block but in that block I can’t add a new cardview and profile like in my video at the beginning

in the second block I can’t change the content of the text

is there another way for me to add initialize globat without changing the block in the add section?
Thank you for your attention