UI Macro giving error on Adding URL in A Href

David Cross
Tera Expert

Error : the reference to entity "topic" Must end with the ';' delimiter. 

 

I am try to give this URL to UI Macro but it's giving me the above error, please help

 

<a href ="https://business.service.com/esc?id=emp_topic&topicId>

 

& => UI macro is not letting me add this symbol in URL.. 

 

Please help

1 ACCEPTED SOLUTION

Iraj Shaikh
Mega Sage
Mega Sage

Hi @David Cross 

The error you're encountering is due to the use of the ampersand ('&') character in the URL within the 'href' attribute of the anchor ('<a>') tag. In HTML, the ampersand is a special character used to denote the beginning of an HTML entity. When you use an ampersand in a URL within an HTML attribute, you need to escape it by using the HTML entity '&amp'; to ensure that it is not mistaken for the start of an entity.

 

Additionally, your 'href' attribute is missing the closing double quote and the closing angle bracket for the anchor tag. Here's how you can correct the URL in your UI Macro:

 

<a href="https://business.service.com/esc?id=emp_topic&amp;topicId=YOUR_TOPIC_ID">Link Text</a>

 

 

Replace 'YOUR_TOPIC_ID' with the actual topic ID you want to use. Also, make sure to provide the text that will be clickable (I've used "Link Text" as a placeholder).

By using '&amp;' instead of '&', you should be able to avoid the error and have a valid URL in your UI Macro.

Please mark this response as correct or helpful if it assisted you with your question.

View solution in original post

2 REPLIES 2

Iraj Shaikh
Mega Sage
Mega Sage

Hi @David Cross 

The error you're encountering is due to the use of the ampersand ('&') character in the URL within the 'href' attribute of the anchor ('<a>') tag. In HTML, the ampersand is a special character used to denote the beginning of an HTML entity. When you use an ampersand in a URL within an HTML attribute, you need to escape it by using the HTML entity '&amp'; to ensure that it is not mistaken for the start of an entity.

 

Additionally, your 'href' attribute is missing the closing double quote and the closing angle bracket for the anchor tag. Here's how you can correct the URL in your UI Macro:

 

<a href="https://business.service.com/esc?id=emp_topic&amp;topicId=YOUR_TOPIC_ID">Link Text</a>

 

 

Replace 'YOUR_TOPIC_ID' with the actual topic ID you want to use. Also, make sure to provide the text that will be clickable (I've used "Link Text" as a placeholder).

By using '&amp;' instead of '&', you should be able to avoid the error and have a valid URL in your UI Macro.

Please mark this response as correct or helpful if it assisted you with your question.

Thank you so much Iraj, 

It's working and also for the explanation