How to delete dynamic card views at once?

I have made a grid view image gallery app using dynamic card view component, the problem is every time when i click on gallery button it creates duplicate card views every time even card views was already created.I wish not to create new card views if already created.

I think it’s because you have give create dynamic cardview component arrangement to three different arrangement, set this to only on arrangement.

Have you got a solution?

Well, i’m Brazillian and not a expert on coding, but i found my self in the same problem some days ago but i found out the solution (for my case).

in the image you can see i add only one single image to the list and call a procedure to do something with that.
the procedure does call the creation of the list it self and also add the card w/ the image i choose.
you can see i use the if then block first cause i wanted a double column cardview list. but the secret here is to not use the for each block if you intend to add image manually and not automatically with images you already set at the app development.
Hope this helps you and someone else!

Mentioned image (i had issues trying to upload from Pc)

Before using the for loop that you use for creating the dynamic card views with. Use another for each number from 1 to ( the length of your list) by 1 to delete the card views, then use this block to delete the card view with the local number variable :
blocks (46)
Here is an example that deletes the card views before recreating them :point_down:
blocks (47)


My solution for this is checking if already has a dynamic component with the id

@Chocoduba_BR Dynamic components created with @yusufcihan extension is not the same as Kodular’s dymamic components (cardview,image, textbox etc…)

1 Like