0

function IfModuleSucceded(sender, args) {

            var existingCount = existingItems.get_count();
            var existEnumerator = existingItems.getEnumerator();

            while (existEnumerator.moveNext()) {

                var currentmodule = existEnumerator.get_current();
                var URL = currentmodule.get_item("Request_URL");

                alert(URL);

            }

        }

In this Code i am trying to Retrieve the url of a Hyperlink column which is in a SharePoint list, using Client object model, but i have received an object. How could i get the Url out of this received object ????

when this code is executed, it gives the alert as "[Object Object]". would anyone help me to sort this out ??

Nera
  • 117
  • 1
  • 1
  • 8
  • yehaaa...i found the anwser...i can use var URL = currentmodule.get_item("Request_URL").get_url(); – Nera Jul 05 '13 at 11:19

2 Answers2

0

The answer will be alert(url.url) as it's an object.

It will also have a property called description

demongolem
  • 9,474
  • 36
  • 90
  • 105
ben
  • 137
  • 5
  • thank you for your answer. i tried but it didn't work. i could get the url by using ".get_url()" – Nera Jul 09 '13 at 03:50
0

The Hyperlink field has two properties: Description and Url.

You can access the properties like this: ObjectName.PropertyName

So for your URL object in your example, you can reach the properties like this: URL.Url and URL.Description

I found that Url and Description are case sensitive, so make sure you capitalize where necessary.

This worked great for me.

Anson
  • 1