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

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

David Miller

David Miller

Executive Financial & Market Analyst

David Miller brings 15 years of experience in global economics, personal finance strategy, and market dynamics. He specializes in turning complex economic trends into actionable insights for everyday readers.

Share this article
Twitter Facebook Pinterest