I am trying to access the field 'ThreadIndex' using the SharePoint REST API.

When I try to include it in the select query option, I am getting a bad request response code.

Here is the URL I am trying:

https://<site>/sites/<list_name>/_api/Web/lists/GetByTitle('list name')/Items?$expand=Author&$select=GUID,ID,TargetID,ThreadIndex,ContentTypeId,Modified,Created,FileDirRef,Title,Body,Author/Id,Author/Title

What am I doing wrong?

The ContentType of the list item is Message with ThreadIndex listed as a column of type 'ThreadIndex'enter image description here


When I make the following call, I can see the field 'ThreadIndex' and it's value:

https://<domain>/sites/<site>/_api/Web/Lists/GetByTitle('list name')/Items(60218)/FieldValuesForEdit

Which returns:

"TrimmedBody": "",
"DiscussionLastUpdated": "2/27/2020 9:18 AM",
"MessageId": "<e160df2a47ca41c2bce7b58e64730b63@SharePoint>",
"ThreadTopic": "",
"ThreadIndex": "0x01D4CABEB71B6ABB4764158C4D4399D589D8B774A45E",

But I need to be able to get this field value without having to select a specific item.

  • Is this custom column created by you? What is the internal name and the data type of the column? Can you tell use the complete error you are getting(just hit this url in browser tab and you will see the exact error). – Ganesh Sanap Mar 5 '20 at 14:25
  • Thank you for the quick reply: The response is as follows: <m:error xmlns:m="schemas.microsoft.com/ado/2007/08/dataservices/metadata"> <m:code>-1, Microsoft.SharePoint.SPException</m:code> <m:message xml:lang="en-US"> The field or property 'ThreadIndex' does not exist. </m:message> </m:error> – Demitrius Mar 5 '20 at 14:34
  • I've updated the main message with image to show the columns for the content type – Demitrius Mar 5 '20 at 14:38
  • Because ThreadIndex is of a type not natively supported by REST, you may have to use the RenderListDataAsStream API. – willman Mar 5 '20 at 16:29

Thank you @willman. That is what I needed

"Because ThreadIndex is of a type not natively supported by REST, you may have to use the RenderListDataAsStream API."

  • Mark this as the answer. :) – Christoffer Mar 6 '20 at 8:11

Which version of sharepoint do you develop? Online or On-Premies. If it on-Premies, following your error, may be threadindex is a custom column, and your sharepoint missing the feature that define info of column type. You can check wsp of custom type. Reinstall it, may be a solution. Hope resolve your case.

  • Thank you for your response. I believe we're on 2016. It seems that ThreadIndex is an internal field: sharepointmalarkey.wordpress.com/2008/08/21/… Could that be why I cannot access? – Demitrius Mar 5 '20 at 15:18
  • Try create a caculate column to get data from threadindex. After get data from new column. May be work. – tmquan Mar 5 '20 at 15:22
  • I have updated the question. Please see above. – Demitrius Mar 5 '20 at 16:18
  • ThreadIndex is a native SharePoint field that is part of the built-in Discussion Board feature that has been available in SharePoint since before SharePoint Server 2007. It is not part of a custom third-party solution. – willman Mar 5 '20 at 16:27

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.