How to conditionally set a link for a text element?

I want to set a link on a text element dynamically, in case a variable contains an url. The link section is bindable - however what do I need to set to be able to set the link conditionally?

If I do it as shown in the image, the link does not open, although a url is provided (instead, a blank page is being opened). If there is no link provided, it works as expected (the cursor does not change to a hand symbol to indicate that the text is clickable).

Any one an idea?

Hi Julian :waving_hand:

The “link property” has several bindable spots, I think you are working with the first one that defines if a link should exist or not, meaning it expects 2 values, either true or false.

If you want to pass down a url directly I believe you need to bind it to the “Target” setting.
You could then also apply a conditional rendering that will render the entire text element with whatever rule you want.
1-

2=

Hi @Agustin_Carozo

Thanks for your response!

I actually bind both the link property (which results in true if a link is provided and false if no link is provided), and the Target property to my link variable. So my expectation was that, in case a link is provided, the link property results in true and the element will link to the provided target url. However, it seems that because I bind the link property, the target property (which is “nested” in the link property) is not respected anymore. (Conditional rendering does not work in this case, as the text element shall be displayed - no matter if a link is provided or not!).

As in my example, there is a variable “Alert Description” and a variable “link”. Alert Description is always provided and used as the text of a text element, the link variable might be empty. If the link variable is not empty, clicking the text element which has the value of the “Alert Description” variable shall link to the given url.
How to do that?