# Cloning and any component block - error or newbie problem?

**URL:** <https://community.thunkable.com/t/cloning-and-any-component-block-error-or-newbie-problem/1196530>\
**Category:** Questions about Thunkable X\
**Tags:** any-component, clone\
**Created:** [March 30, 2021, 4:49pm UTC](https://community.thunkable.com/t/cloning-and-any-component-block-error-or-newbie-problem/1196530 "2021-03-30T16:49:28Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![catsarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/catsarisky/32/100661_2.png) [@catsarisky](https://community.thunkable.com/u/catsarisky)\
**Post date:** [March 30, 2021, 4:49pm UTC](https://community.thunkable.com/t/cloning-and-any-component-block-error-or-newbie-problem/1196530/1 "2021-03-30T16:49:28Z")

</div>

I’m trying to clone a row, and then I need to get the components in the row. This doesn’t seem to be working. Here are my blocks:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/f/5fab45e52fc24b744d2ce0607ef8feb01a5885d2.png)  
I’m getting an empty list for “all Label in clone”, although “clone” itself is populated. The label in the clone is unchanged.  
This is definitely related to the ‘clone’ block, because if I switch out ‘row\_to\_clone’ for ‘clone’, everything works as expected.

Here’s a link to the minimalist project: [Thunkable](https://x.thunkable.com/copy/b693b6b02093728ade837e12ed115f37)

I was really hoping /not/ to do what’s in this post, because it looks like a pain in the rear, and potentially fragile if I make UI changes later.

> [@Changing properties of cloned components (DIY Advanced Listviewer)](https://community.thunkable.com/t/changing-properties-of-cloned-components-diy-advanced-listviewer/153213/2):
>
> Here is an example of how to display a list of data using custom rows and how to delete one of the list items. The data we want to display How to Design a Custom List Viewer Inside a Column, there is a single Row that will be Cloned and Populated in later steps. [16%20PM] [33%20PM] Note: We will now clone the rows for each item in our list, populate the labels, and allow the button to delete the rows. How to Display a List of Data in a Custom List Viewer (by Cloning) The credit …

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [March 30, 2021, 6:37pm UTC](https://community.thunkable.com/t/cloning-and-any-component-block-error-or-newbie-problem/1196530/2 "2021-03-30T18:37:02Z")

</div>

I feel like that should work. And yet it doesn’t. The green clone block holds an object (a row, copied from the original). So you should be able to get the first list item from the list of “all Label in clone”. Yet it doesn’t change the cloned label’s text so I’m a bit baffled.

A clue is that it’s not displaying the clone block’s object data as JSON. I just see when it’s previewed. Or rather, it is displaying it but it’s empty.

---

<div class="post-metadata">

**Author:** ![catsarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/catsarisky/32/100661_2.png) [@catsarisky](https://community.thunkable.com/u/catsarisky)\
**Post date:** [March 30, 2021, 7:25pm UTC](https://community.thunkable.com/t/cloning-and-any-component-block-error-or-newbie-problem/1196530/3 "2021-03-30T19:25:42Z")

</div>

So… If I add a wait block as the first block within the clone’s ‘do’, it works. Exactly as expected. Apparently ‘clone’ needs some time to get populated?

ARGH. Asynchronicity makes my head hurt!

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [March 30, 2021, 9:08pm UTC](https://community.thunkable.com/t/cloning-and-any-component-block-error-or-newbie-problem/1196530/4 "2021-03-30T21:08:21Z")

</div>

Somebody who looks a lot like me figured out a while ago that a wait block was needed when cloning components as part of a loop but… you weren’t using a loop so that’s surprising.

> [@Cloning images returns blanks](https://community.thunkable.com/t/cloning-images-returns-blanks/1042304/2):
>
> Hi Inga, What’s happening is that your repeat loop is firing the Clone block repeatedly without any delay. But the “do” section of the Clone block doesn’t have time to complete it’s blocks before the next image clone is created. So you either need to add a Wait block inside the repeat loop, after the Clone block, and set it to a small number like 0.01 or 0.03. That may work. Or, you need to do all the cloning first and then use a separate loop to set the pictures of all of the cloned images. …

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [March 31, 2021, 12:14pm UTC](https://community.thunkable.com/t/cloning-and-any-component-block-error-or-newbie-problem/1196530/5 "2021-03-31T12:14:35Z")

</div>

See my comments about an issue with the calendar app.

> [@Create a 2020 Calendar](https://community.thunkable.com/t/create-a-2020-calendar/456520/53):
>
> Nothing wrong in the code. I tested it. When you run it as is it would, most probably, 111111. The cloning in the makeCalendar function works asynchronously and you need to provide a wait block or any other task that would allow the cloning process to finish and then try to count the number of buttons. [image] I added 1 sec wait and the process worked successfully.

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [March 31, 2021, 3:38pm UTC](https://community.thunkable.com/t/cloning-and-any-component-block-error-or-newbie-problem/1196530/6 "2021-03-31T15:38:08Z")

</div>

Interesting that you found that a wait block _after_ the cloning loop was necessary. So it’s almost as if the clone block starts the process but the “all buttons” list isn’t populated with the new objects until all of the cloning is completed.

My assumption would be that the “do” section of the clone block would have a delay built in. But that doesn’t seem to be the case.

@domhnallohanlon Any clarification on this? Curious if the clone block just needs a little reworking.

---

<div class="post-metadata">

**Author:** ![catsarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/catsarisky/32/100661_2.png) [@catsarisky](https://community.thunkable.com/u/catsarisky)\
**Post date:** [March 31, 2021, 3:43pm UTC](https://community.thunkable.com/t/cloning-and-any-component-block-error-or-newbie-problem/1196530/7 "2021-03-31T15:43:01Z")

</div>

I wasn’t actually cloning in a loop, but in response to a button click. As a single event, it still needs that wait.

I really like Thunkable, but it annoys me that an early step in my debugging process has become sprinkling wait blocks everywhere to see if the problem vanishes. I want a “no, seriously, don’t go on until the previous step is done” block.

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [March 31, 2021, 3:47pm UTC](https://community.thunkable.com/t/cloning-and-any-component-block-error-or-newbie-problem/1196530/8 "2021-03-31T15:47:36Z")

</div>

I realize yours wasn’t a loop which is what surprised me about needing the wait block. I’ve seen this happen where someone has a clone block or database lookup block inside a fast loop and the requests they are sending don’t have enough time to complete.

But the fact yours _wasn’t_ in a loop was what seemed strange. I wouldn’t expect it to need a delay but based on what @muneer shared, I see that it does need a wait block.

---

<div class="post-metadata">

**Author:** ![catsarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/catsarisky/32/100661_2.png) [@catsarisky](https://community.thunkable.com/u/catsarisky)\
**Post date:** [March 31, 2021, 3:51pm UTC](https://community.thunkable.com/t/cloning-and-any-component-block-error-or-newbie-problem/1196530/9 "2021-03-31T15:51:29Z")

</div>

I think what’s different about my case is that I need a wait to use the contents of the clone WITHIN the do block of the clone itself. I thought those asynchronous purple blocks at least didn’t start on their ‘do’ until they were done…

The clone value is populated right away, but the contents of the clone need time to be there…

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [March 31, 2021, 3:53pm UTC](https://community.thunkable.com/t/cloning-and-any-component-block-error-or-newbie-problem/1196530/10 "2021-03-31T15:53:15Z")

</div>

There was a problem like this a while ago. I can’t remember if it was with the clone block specifically but it may have been. The “do” section was simply running immediately. It was fixed so hopefully this isn’t a difficult fix.

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 1:25pm UTC](https://community.thunkable.com/t/cloning-and-any-component-block-error-or-newbie-problem/1196530/11 "2024-11-08T13:25:40Z")

</div>


