web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

How to add hyperlink in oData

(0) ShareShare
ReportReport
Posted on by

Hi,

I am working on oData.

I need to extract customer address as a link (need to add cust_Address hyperlink in oData and when user click on hyperlink; google map will be open)

Example:

"@odata.etag":
"W/\"JzMjg3NTQwNTksNTYzNzE0NjA3Nic
=\"","OrderNumber":"XYZ-001","CustomerAddress":"Cust_Address"<How to add hyperlink?>,"Quantity":2}

I am able to get customer address in google map but needs your help to wrap into hyperlink.


#DEFINE.MapURL('www.google.com/.../')
#DEFINE.comma(',')
#DEFINE.newLine('\n')

str address;

address = 'Lahartara' + #comma +
'Varanasi' + #comma +
'Uttar Pradesh' + #comma +
'221002' + #comma +
'IND';

// Replace the newline with comma
address = strReplace(address, #newline, #comma);

// URL encode
address = System.Web.HttpUtility::UrlEncode(address);

// Add the address to the URL
Info(strFmt("%1",#MapURL+ address));

Browser browser = new Browser();
browser.navigate(strFmt(#MapURL+ address));

// Info(strFmt('<html><body><a href=%1>VendorURL</a></body></html>', (#MapURL+ address)));

// new Browser().Navigate(strFmt(#MapURL+ address));



I have the same question (0)
  • Sergei Minozhenko Profile Picture
    23,093 on at
    RE: How to add hyperlink in oData

    Hi,

    Do you want to see hyperlink in JSON response. Or you want to get link from json and make it clicable in your application?

  • Community Member Profile Picture
    on at
    RE: How to add hyperlink in oData

    Thanks Sergei for your response.

    I want hyperlink in Json response and these Json response I'll need to send to other application.

    Can you please help on it.

    Thanks.

  • Martin Dráb Profile Picture
    236,751 Most Valuable Professional on at
    RE: How to add hyperlink in oData

    JSON is a text format and plain text doesn't have hyperlinks. Usually you just put URL to your JSON and it's up to the consumer to take the URL and visualize it as a hyperlink (assuming that the consumer has GUI, of course).

    You seem to be trying to insert a piece of HTML in JSON, which is technically possible, but it's again on the consumer to process the value in some way (e.g. inserting it at a certain place in a web application).

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 753

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 752 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 534 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans