0

The below list contains columns which are simply years (set to contain 0 decimal points). The current columns are 2016, 2017, 2018, 2019, and 2020. In use, the end user selects a date on a calendar and selects an item from a drop down which results in the calendar date plus the drop-down selection creating a new name for the 'job' (JavaScript). The underlying issue I'm experiencing is that this script breaks with all columns "2020" through "2029". When using SharePoint REST API to query the title of the list, I receive the following results:

...    
<content type="application/xml">
             <m:properties>
                <d:FileSystemObjectType m:type="Edm.Int32">0</d:FileSystemObjectType>
                <d:Id m:type="Edm.Int32">1</d:Id>
                <d:ContentTypeId>0x01001D3C31E3C524534A9B2BBEEBC4FF00B2</d:ContentTypeId>
                <d:Title>OM</d:Title>
                <d:OData__x0032_016 m:type="Edm.Double">126</d:OData__x0032_016>
                <d:OData__x0032_017 m:type="Edm.Double">73</d:OData__x0032_017>
                <d:OData__x0032_018 m:type="Edm.Double">58</d:OData__x0032_018>
                <d:OData__x0032_019 m:type="Edm.Double">86</d:OData__x0032_019>
                <d:OData__x0032_020 m:null="true" />
                <d:ID m:type="Edm.Int32">1</d:ID>
                <d:Modified m:type="Edm.DateTime">2019-12-18T20:07:12Z</d:Modified>
                <d:Created m:type="Edm.DateTime">2016-05-03T16:12:03Z</d:Created>
                <d:AuthorId m:type="Edm.Int32">1</d:AuthorId>
                <d:EditorId m:type="Edm.Int32">24</d:EditorId>
                <d:OData__UIVersionString>1.0</d:OData__UIVersionString>
                <d:Attachments m:type="Edm.Boolean">false</d:Attachments>
                <d:GUID m:type="Edm.Guid">66d5c038-001e-4471-b0f5-c9ed0169f3dc</d:GUID>
             </m:properties>
          </content>
...

As you can see on line 11 the year "2020" is appearing as null rather than a double data type like the rest of the columns which, I believe, is what is causing this web request error ('CQ' being the selection from the drop down)...

GET https://server/sites/Estimation/_api/lists/getbytitle('list')/items?$select=ID,OData__x0032_0&$filter=Title%20eq%20%27CQ%27 400 (Bad Request)

...considering that all other years result in GET 200 Successes. I'm simply using the Site Settings module within the site to create a new list column. To verify it this isn't a browser/cache issue, I've created and deleted this 2020 column with SharePoint Management Shell as well with the same results.

Could someone help me identify how this column could result in SharePoint not being able to recognize it as the number that it is? Please let me know if you would like any more information. I appreciate any insight.

1 Answer 1

0

In SharePoint REST APIs we need to use the internal name of the columns.

And the internal name of your column is OData__x0032_020.

I can see an error you made in internal name of column in $select query.

Try using it like below:

https://server/sites/Estimation/_api/lists/getbytitle('list')/items?$select=ID,OData__x0032_020&$filter=Title eq `CQ`
1
  • 1
    I believe the issue at fault is the Javascript that is requesting this information which I understand doesn't belong in this section, so I'll troubleshoot elsewhere; however, your clarification pointed me in the correct direction. Thanks a lot for the information. Commented Dec 28, 2019 at 0:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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