3
  • I am displaying the SharePoint List items based on ID value using JSOM.
  • And among the list columns there is "Hyperlink" column which is showing the value as "[object Object]" when retrieving

Can any one help me how can I get the Description and it's Url for a Hyperlink column using JSOM

1 Answer 1

7

Hyperlink is a object. You can get its property by following

For description

listItem.get_item("{column internal name}").get_description()

For Url

listItem.get_item("{column internal name}").get_url()
4
  • Just a tip, if they don't have values, the field will return as null value. (listItem.get_item("{column internal name}") != null ) ? listItem.get_item("{column internal name}").get_url() : "" Aug 24, 2016 at 7:02
  • Dear Atish,Thanks for your support .I need combination of both as single value. and I am getting "Error as : The property or field has not been initialized. It has not been requested or the request has not been executed. It may need to be explicitly requested."
    – MSA
    Aug 24, 2016 at 7:03
  • Yes @AndersAune. OP needs this checking if his field is optional. Aug 24, 2016 at 7:19
  • You need to load the item before accessing it. Can you share your code so that I can help you more. @MSA Aug 24, 2016 at 7:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.