I have a lookup list that contains a choice field.
I'm trying to retrieve it's values using rest
Expand= "list" Select= "list/ChoiceField"
The query to field 'list/ChoiceField' is not valid."
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It only takes a minute to sign up.Sign up to join this community
Consider the following scenario:
List A with columns:
List B with columns:
So the REST Query for List B would be:
The above concept doesnt work on choice type of column. For choice type column, you can use below concepts.
Concept 1: Use of hidden column (text), with Workflow/ER.
In this case, use Event Receiver (for SPO Webhook) or Workflow to read the value of choice column and update the hidden column with these values.
Pros: You can use the above query to expand the hidden column.
Cons: You need to have another steps in between, to convert content of choice column to text column.
Concept 2: Use List Field endpoint, instead of List Item endpoint. If you know the item ID of ListB item, then you can directly hit field endpoint to get all the column values of Lookup ListA.
Pros: No extra conversion method required as listed in concept 1.
Cons: Low on performance, as you require the item ID in this case.