Use Rest API to return link from sharepoint list

developer sp1 461 Reputation points
2021-01-11T02:14:08.123+00:00

I've tried appending the url in the code below with "/_api/web/lists/getbytitle('test')/items**?$select=URL**" without success.

successfully using the code to display the title field - but NOT the url from the hyperlink field:

55132-snipaste-2021-01-11-10-13-10.png

Can anyone help me on this ?

Microsoft 365 and Office SharePoint Server Development
0 comments No comments
{count} votes

Accepted answer
  1. ZhengyuGuo 10,586 Reputation points Moderator
    2021-01-11T06:22:04.73+00:00

    Hi @developer sp1 ,

    In onQuerySucceeded function, Try this line:

    listItemInfo += '<b>UrlFromHyperLinkField:</b> ' + value.TestHyperLink.Url+ '<br />';  
    

    In my side, the HyperLink named "TestHyperLink", you can replace this field name with yours to make it work.

    55060-snipaste-2021-01-07-16-47-56.png

    Thanks
    Best Regards


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.