Can we make href dynamic in dcc.Link?

ola,
I am new to dash. I have create a button using dcc.Link . I am trying to update href component using a callback to update href link from "/" to "/{variable1}/{variable2}", but it is not working.

dcc.Link(

            html.Button("Launch", n_clicks=0, id="my_button"),

            id="my_link",

            href="/"

            refresh=True,

            target="_blank",

        ),

Hey, could you show us what you tried to write in your callback so we can help you make it work?

Thanks for your reply but this is resolved. I was trying to update the link on button click and expecting it to open the updated link in new tab, but instead I split it into 2 callbacks, one to update href link and other to perform nclick operation.

1 Like

Could you be more specific how did you split it to two functions? I am facing the similar problem.
Thx