1

I have two custom list client and transaction.

client list contain Status choice column. Now client name is lookup column of Transaction list. I am trying to get using exapand ClientName Lookup column and make filter on it like below. But its throws Bad Request.

ClientName/Status+eq+Complete 

Any help highly appreciated.

1

Unfortunately you can't use REST query on status field, because the type of the field is choice. In SharePoint it's not allowed to create a lookup to point to the choice field, this is root cause of such behavior.

But hopefully it is possible to use lookup with calculated text column.

So you can workaround your issue by creating calculated column inside Client list, say StatusCalc with formula =Status. The main purpose of this field is simply showing the value of corresponding choice field.
Now you can use REST as following:

_api/web/lists/getbytitle('temp')/items?$select=client/StatusCalc,Title,Id&$expand=client&$filter=client/StatusCalc+eq+'my choice' 
  • i have tried this still it give 400 Error Code. if i remove from filter then its work well – Vishal Thakkar Nov 10 '16 at 10:19
  • Right, you need to apply url encoding, I missed that. Updated answer – Sergei Sergeev Nov 10 '16 at 10:28
  • I have posted url that also not work – Vishal Thakkar Nov 10 '16 at 10:29
  • For multiple filters you need to use and keyword, instead of comma, ie $filter=(StartDate ge datetime'2014-01-01T00:00:00Z') and (EndDate le datetime'2013-12-31T00:00:00Z') – Sergei Sergeev Nov 10 '16 at 10:31
  • "and" for and operations and "or" for or :) – Sergei Sergeev Nov 10 '16 at 10:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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