Get Text in List of Label made using Dynamic Components when another Label is Clicked

Hi Koders,
I was making an To Do App where I wanted to get text of a List of label (To Do things) and I want to copy it, when another Label is clicked.
I tried several options but did not work.
This is one of the options I tried.


But I got the below Error

Image

Can anyone help me with this?

1 Like

why are you using join

@luv.ak.tech
I took the reference of the below

and

Try this -

1 Like

This error coming because the component that u are using to take text has not created

1 Like

U have error in ur ids

1 Like

@luv.ak.tech
I have also tried this method.
When I click on the on the copy button it only gives the text of the copy button.


@iamwsumit
Blocks

try like this-
blocks (6)

:slightly_frowning_face: Did not Work,
It is still Copying the text on Copy Button which is content_copy

Hi,

Replace your second label (copy) with a button.

Do you mean something like this


When I do it I get the same error.

What if I need buttons for another purpose like translate the text?
Is there no way to accomplish with the help of Labels?

Now try this: without using join block.

For which component do u want to copy the text

Sorry @iamwsumit ,
I guess I had to elaborate it.

I created a new project as the old one was messed up and I made some changes.

In device
This is the design of my App. (Not Focused on the UI/UX yet)

In the Blocks
The List procedure

The Variables

Button Function
Image

And Lastly the block which I want to get text when Clicked
image

I guess this understands my problem.

First u need to check the the component is dynamic or not the if Id matches with that label that u want to copy the text then copy…

1 Like

Try something like this

2 Likes

@dora_paz I think it will not work beacuse both component are same and u are setting sam eids to both

For testing purposes I created 5 labels dynamically

image

When any label clicked, it copies the text of that label and it works for me

beacuse u are creating only 1 label dynamically

and as u can see get property u can directly use get component variable but u are using get component block and get id block

1 Like

You are right :slight_smile: works also like this