user3932624
user3932624

Reputation: 21

Reading Values from Choice Field of Sharepoint List

I am making AJAX call to a Sharepoint list which contains a Choice (checkbox) field. For this field the user can select multiple Countries for which a person is responsible.

enter image description here

enter image description here

AJAX call made to this list returns a href parameter containing a link for the related country values (TestContact(1)/Country) and not the actual values.

enter image description here

This means I need to make additional calls to get Country values for each of the records. So for 100 records I need to make 100 AJAX calls.

Is there any option (some parameter in Sharepoint Link) by which I can set to get Country values against each record in one single AJAX call?

Cannot convert this field to Single / Multiple lines of text as it will allow user to maintain any value (India or Indien / Germany or Deutschland / etc).

Sharepoint Link used in AJAX Call: https://domain.com/sites/app/_vti_bin/listdata.svc/TestContact

Thanks,

Abhishek.

Upvotes: 0

Views: 1283

Answers (1)

Vadim Gremyachev
Vadim Gremyachev

Reputation: 59358

Modify your request from:

https://domain.com/sites/app/_vti_bin/listdata.svc/TestContact

to:

https://domain.com/sites/app/_vti_bin/listdata.svc/TestContact?$expand=Country

In that case the related entries (Country) will be retrieved along with entries identified by the resource path (TestContact) via a single HTTP request.

Reference

Expand System Query Option ($expand)

Upvotes: 1

Related Questions