Bring Drag & Drop to Dash with Dashboard Engine. 💫 Learn how at our next webinar!

Passing id as href

Hi everyone,

I am generating urls based on two inputs in my dash app. I am returning the urls in a table with the html.A tag. They appear to be links but I can not click on them. I understand that I need to specify the actual url with href= - but how do I pass the id of my callback as href?

 @dash_app.callback(
        [Output('url_output', 'children'),
        Output('url_output2', 'children')],
        [Input('search', 'n_clicks')],
        state=[State('input-1', 'value'),
        State('input-2', 'value'),
    ])
    def compute(n_clicks, input1, input2):
        if n_clicks is None:
            return PreventUpdate
        else:
            URL GENERATION CODE
            

            return url_output
html.Tr([html.Td(['row1']), html.Td(html.A(id='url_output', target='_blank'))])

[Output(‘url_output’, 'href’),
Output(‘url_output2’, 'href’)],

use ‘href’ to set the href
on the return, return for both Outputs

def compute(n_clicks, input1, input2):
if n_clicks is None:
return PreventUpdate
else:
url_output = 'http://xyz.cm
url_output2 = ‘http://def.com

   return url_output  , url_output2


        

        return url_output