Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

How to access Choice Field Value by using Lookup Field in REST API?

$
0
0

I have a list(ListA) which has a lookup field(LookupF) for another list(ListB). ListB includes a choice field(ChoiceF) which can take a single value.

I want to call the selected value of the ChoiceF by using the LookupF in SP 2013 REST API.

This url doesn't work:

http://appWebUrl/_api/web/lists/getByTitle("ListA")/items?$select=LookupF/ChoiceF&$expand=LookupF

Error:The query to field 'LookupF/ChoiceF'isnot valid.


On the other if I create a calculated field(CalculatedF) which is equal to the value of ChoiceF ([=ChoiceF]) in ListB, then I can access the value using the following url:

http://appWebUrl/_api/web/lists/getByTitle("ListA")/items?$select=LookupF/CalculatedF&$expand=LookupF

I do not want to create unnecessary fields like these, just to be able to get the selected choice values. Is there any direct way to access choice values for lookup fields?





Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>