querying fields with name containing whitespace using OData

I have to make a $filter query on a field that's name contains whitespace. Eg, $filter=Ticket No eg 'abc_123'

I'm starting to think its not possible. Can someone help me with this please?

Thanks.

0

2 Answers

Thought I'd share this, I was trying to query rest services through my SharePoint hosted SharePoint 2013 app and well I found the solution. All you need to do is replace the spaces in the field name by _x0020_

4

OData property names cannot contain spaces. Refer to the xsd schema here. Look for the type TSimpleIdentifier in the schema. The definition looks like the following,

<xs:simpleType name="TSimpleIdentifier"> <xs:restriction base="xs:string"> <xs:maxLength value="128" /> <!-- ECMAScript identifiers not starting with a '$' --> <xs:pattern value="[\p{L}\p{Nl}_][\p{L}\p{Nl}\p{Nd}\p{Mn}\p{Mc}\p{Pc}\p{Cf}]{0,}" /> </xs:restriction>
</xs:simpleType>
0

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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

You Might Also Like