How to add url as hyperlink to the variable

Hi,

Need help in adding URL as hyperlink to the variable, is there a way to achieve this?

Thanks,
Farooq

Hi @Mohammed_Umar_Farooq

  1. you can create a string variable named “URL” to hold the URL.
  2. Use the “Assign” activity to assign the URLto the variable “url”.
  3. Use the “Assign” activity to create a new string variable that contains the HTML code for the hyperlink. Use the below expression:
    “” + url + “”
  4. This expression concatenates the value of the “url” variable with the HTML code for the hyperlink.
  5. Use the “Assign” activity to assign the HTML code to a new variable. For example, you can create a string variable named “htmlCode” and assign the HTML code to it.

Hi Nitya1,

Thanks for the quick response!

But let me explain in more details:

I need to make the string as hyperlink and do not have much knowledge on html part.

Thanks,
Farooq

Hi @Mohammed_Umar_Farooq

You can use a href attribute to convert your string as a hyperlink. Look at this syntax:

<a href="HyperLink_Address">Your String<a>

Ex: <a href="https://www.google.com">Google</a>

Hope this helps,
Best Regards.

Hi Arjun,

Thanks for your response, I understood how to convert the string to hyperlink.

Could you also please let me know: " If i click on the string it should redirect me to the url"

Eg: “ABC-3232” is a string and when I click this string which is hyperlink, it should direct me to the url.

Thanks,
Farooq

@Mohammed_Umar_Farooq

In that case, you can specify the redirection url in the href=" " part. Let’s say when you click on ABC-3232, it should be redirected to the url - www.abc3232.com, then you specify it like:

<a href="www.abc3232.com">ABC-3232</a>

Hope this helps,
Best Regards.

Thanks again Arjun,

I wanted to achieve this as in SS.

But when i do the same in UiPath I am getting whole string in the Output. Insteat of “ABC-3253”. Any thoughts plz.

Thanks,
Farooq

@Mohammed_Umar_Farooq where are you trying to use this hyperlink?

Hi fasil,

I want to give the hyperlink value in one of the field of Automation hub using UiPath studio!

Hi @Mohammed_Umar_Farooq ,

Could you let us know what was the implementation done and how was it checked ?

Also, In reference to the above statement, do you have an example already of a Hyperlink that is available in the Automation Hub, maybe you could check the content or if possible you could provide us with a Screenshot so that we can confirm on how you would require the hyperlink.

Sure Arpan.

The details are below:

I assigned “html” variable with below value:
image

And i am trying to send this variable through an API post method to Automation hub!

Output is like this in SS
image

But I am expecting only “google” as hyperlink in Jira Automation field of Automation Hub.

Please let me know if you are clear with my requirement.

Thanks,
Faroooq

@Mohammed_Umar_Farooq

Since you are trying to sending it via API Post Method, provide the string that you want to convert as a hyperlink in the body of the request, along with the other required parameters. Try something like this:

{
  "name": "Test Hyperlink",
  "description": "Hyperlink for Google redirection",
  "content": "<a href="https://www.google.com">Google</a>",
  "contentType": "text/html"
}

content field contains the string that you want to convert to a hyperlink. The contentType field specifies the type of content, which is text/html in this case.

Hope this helps,
Best Regards.

1 Like

i will add more The syntax you provided is the HTML markup for creating a hyperlink.
Here is breakdown
"href"web address that the hyperlink will navigate to “Your String” This is the text or content that will be displayed as the clickable link.
Something like that <a href="HyperLink_Address">Your String</a> .
On other hand you may verify your URL on RedirectChecker.com to get detail redirection chain and its status code and much more deep information