How to add click listener in two differents buttons in dynamic components please help me

how to add click listener in two differents buttons in dynamic components please help me.

actually i made a list view with the help of dynamic components in which two differents button.i want to do two differents activity from btns . from first btn i want to open url and second btn i want to open another screen how to do that please help me .below is my blocks

1 Like

You Can Make A Unique Id Of Button

Change The Name Of Button Where I Have Pointed

And Get It By If Then Condition


In Then Section You Can Preforms Action As You Want


as u told i done but it is not working .please help

Share blocks again what you have done

Because You Have Doing Wrong Way

Set In ID With Join Block butto1 + id Like This


after that coming error and not making dynamic components

Now It’s Working ??

no please help me

the general idea is
you need to make 2 different ID name

and when any component click just split the component ID name and compare it


but very long process if any other idea then tell .thanks

Above Method That I Have Told You Will Work Correctly If You Lookup

actually is not long
first, you create the dynamic component ID and split with special char (such as β€œ_”) then create block to monitor event click and split the result with that special char, and compare it.
good luck

i tried your method i have given u blocks above but not working for me please tell me why

sorry for the wrong block at first, I upload the correct one.
please check

I can help you with this,this error occurs when you have more than1 button onclicklistener

please help me

First set the ID for each button on created dynamically.
Next when any button click get the ID and ID = 1 open url, if ID = 2 open other screen.

Edit: if you have 2 buttons why created this dynamically ?