SharePoint / sp-dev-docs

SharePoint & Viva Connections Developer Documentation
https://docs.microsoft.com/en-us/sharepoint/dev/
Creative Commons Attribution 4.0 International
1.24k stars 994 forks source link

Missing field "createdDateTime" when retrieving pages of a site #8831

Open roelplieger opened 1 year ago

roelplieger commented 1 year ago

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

💥 SharePoint Framework

Developer environment

Linux

What browser(s) / client(s) have you tested

Additional environment details

Describe the bug / error

When retrieving news items of a site using the Microsoft Graph API the field "createdDateTime" is missing. The url we're using is: https://graph.microsoft.com/beta/sites/{siteId}/pages?expand=webparts&$filter=promotionKind%20eq%20'newsPost' This returns all news items successfully, but without the specified field.****

Steps to reproduce

  1. determine the siteId of the site
  2. call the MS Graph URL with the siteId in it
  3. see that the field is missing (attached an example of what is returned, all personal info is replaced by "x"). SharePoint-export.txt

Expected behavior

Following the documentation on https://learn.microsoft.com/nl-nl/graph/api/resources/baseitem?view=graph-rest-beta we would expect to see the field "createdDateTime" in the results.

ghost commented 1 year ago

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

jamesmacwhite commented 7 months ago

Also confirming the same problem, pulling newsPost content using a filter of promotionKind eq 'newsPost', does not provide the createdDateTime value in the API response.

You appear to be able to use it in an orderby criteria. but you cannot select it in the data, the only date field available is lastModifiedDateTime

This appears specific to the SharePoint Pages BETA endpoint, other endpoints like getting list items, do provide the field.

jamesmacwhite commented 7 months ago

@VesaJuvonen @sangle7. Is there any update on this regarding the API? I appreicate the API endpoint for SharePoint pages is still BETA.

Looking at the update video in July 2023: https://devblogs.microsoft.com/microsoft365dev/microsoft-graph-for-sharepoint-pages-public-preview-update/, the examples used also showed the createdDateTime property missing from the responses as well during the presentation.

Will this be fixed? Based on the roadmap, it looks like March 2024 is intending to be the general availability date for when the API goes to production?

sangle7 commented 6 months ago

@jamesmacwhite Hi, thanks for reporting this. Will take a look and get back to you soon

jamesmacwhite commented 6 months ago

@sangle7 Thank you! @roelplieger originally reported it. I just found this GitHub issue when I also came across the same problem when using the SharePoint pages BETA API with news posts.

sangle7 commented 6 months ago

The fix has been checked in and should be deployed in ~3 weeks

jamesmacwhite commented 6 months ago

@sangle7 Thank you, this is great news! Look forward to testing it out when deployed.

jamesmacwhite commented 6 months ago

This appears to be now deployed and being returned in the API!