sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

ProjectedFields in the renderlistasstream API endpoint seem to have stopped working

Open marcus-atvero opened this issue 2 years ago • 15 comments

Target SharePoint environment

SharePoint Online

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

💥 SharePoint Framework

Developer environment

macOS

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

  • [ ] 💥 Internet Explorer
  • [X] 💥 Microsoft Edge
  • [X] 💥 Google Chrome
  • [ ] 💥 FireFox
  • [X] 💥 Safari
  • [ ] mobile (iOS/iPadOS)
  • [ ] mobile (Android)
  • [ ] not applicable
  • [ ] other (enter in the "Additional environment details" area below)

Additional environment details

SharePoint API

Describe the bug / error

We use the SharePoint renderlistasstream REST API from within our SPFx app and write CAML queries to project fields from joined tables. These queries have run successfully for years.

These projections stopped working on Thursday on our dev tenancies, and has started impacting customer tenancies today.

Was there a published / expected change to this API that we missed, or is this a regression?

Example CAML code below.

   <Joins>
        <Join Type='LEFT' ListAlias='Company'>
          <Eq>
            <FieldRef Name='ATVCompanyLookup' RefType='Id'/>
            <FieldRef List='Company' Name='ID'/>
          </Eq>
        </Join>
      </Joins>
      <ProjectedFields>
        <Field Name='ATVCompanyLookup_ID'
          Type='Lookup'
          List='Company'
          ShowField='ID'/>
        <Field Name='ATVCompanyLookup_ATVCompanyCode'
          Type='Lookup'
          List='Company'
          ShowField='ATVCompanyCode'/>

      </ProjectedFields>

We now get just the lookup IDs but not the expanded view fields when running any query making a join and projecting fields.

Steps to reproduce

Running queries against the REST API endpoint from any browser

Expected behavior

We expected the lookup values to be projected as the named fields in the server API response.

marcus-atvero avatar Jul 24 '23 12:07 marcus-atvero

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

ghost avatar Jul 24 '23 12:07 ghost

@marcus-atvero - could you please share a minimal config and code to repro the issue. I'm interested in lists schemas and piece of code that you're using to get the data.

Thanks!

AJIXuMuK avatar Jul 24 '23 21:07 AJIXuMuK

I also have the same problem, apparently something was updated at the tenant level

josergio1 avatar Jul 25 '23 17:07 josergio1

The same problem occurred on German servers, but not on other servers

liupeng1239 avatar Jul 26 '23 07:07 liupeng1239

Can someone provide a minimal config and code snippet to repro an issue? Thanks!

AJIXuMuK avatar Jul 26 '23 13:07 AJIXuMuK

Hi, we are using PnPJS to make the query, so just pulling that together and will follow up with it.

For my example above, we have a SharePoint list with a single lookup onto another list called Company. The single lookup is called ATVCompanyLookup.

The Company list has a text field called ATVCompanyCode

We've worked around this by adding the columns we want to the list view (which you can do manually on the Lookup column by choosing other columns to project for the lookup) and those values appear, but the projection in the CAML query to the renderListAsStream above returns the named fields, as Lookup fields with the id specified, but not the value.

marcus-atvero avatar Jul 26 '23 16:07 marcus-atvero

We also use the pnpjs's renderListDataAsStream fun to get join items, we use the same code, but only one customer has this problem and the others don't.

liupeng1239 avatar Jul 27 '23 02:07 liupeng1239

Sorry, we use PnP in ReasonML so the code isn't easy to share, but our failing XML query is

<View>
  <Joins>
    <Join Type='LEFT' ListAlias='DLM_Placeholders'>
      <Eq>
        <FieldRef Name='ATVSupersededBy' RefType='Id'/>
        <FieldRef List='DLM_Placeholders' Name='ID'/>
      </Eq>
    </Join>
    <Join Type='LEFT' ListAlias='DLM_Revisions'>
      <Eq>
        <FieldRef Name='ATVLastRevision' RefType='Id'/>
        <FieldRef List='DLM_Revisions' Name='ID'/>
      </Eq>
    </Join>
    <Join Type='LEFT' ListAlias='DMS_Library'>
      <Eq>
        <FieldRef Name='ATVDocumentLookup' RefType='Id'/>
        <FieldRef List='DMS_Library' Name='ID'/>
      </Eq>
    </Join>
    <Join Type='LEFT' ListAlias='Confidential_DMS_Library'>
      <Eq>
        <FieldRef Name='ATVConfidentialDocumentLookup' RefType='Id'/>
        <FieldRef List='Confidential_DMS_Library' Name='ID'/>
      </Eq>
    </Join>
  </Joins>
  <ProjectedFields>
    <Field Name='LastRevision_ATVDateKey' Type='Lookup' List='DLM_Revisions' ShowField='ATVDateKey'/>
    <Field Name='LastRevision_ATVDescriptionField' Type='Lookup' List='DLM_Revisions' ShowField='ATVDescriptionField'/>
    <Field Name='LastRevision_ATVDocumentNumber' Type='Lookup' List='DLM_Revisions' ShowField='ATVDocumentNumber'/>
    <Field Name='LastRevision_ATVDocumentTitle' Type='Lookup' List='DLM_Revisions' ShowField='ATVDocumentTitle'/>
    <Field Name='LastRevision_ATVQAApprovalString' Type='Lookup' List='DLM_Revisions' ShowField='ATVQAApprovalString'/>
    <Field Name='LastRevision_ATVReceivedReference' Type='Lookup' List='DLM_Revisions' ShowField='ATVReceivedReference'/>
    <Field Name='LastRevision_ATVRenditionTypes' Type='Lookup' List='DLM_Revisions' ShowField='ATVRenditionTypes'/>
    <Field Name='LastRevision_ATVRevision' Type='Lookup' List='DLM_Revisions' ShowField='ATVRevision'/>
    <Field Name='LastRevision_ATVScaleField' Type='Lookup' List='DLM_Revisions' ShowField='ATVScaleField'/>
    <Field Name='LastRevision_ATVSizeField' Type='Lookup' List='DLM_Revisions' ShowField='ATVSizeField'/>
    <Field Name='LastRevision_ATVStatusField' Type='Lookup' List='DLM_Revisions' ShowField='ATVStatusField'/>
    <Field Name='LastRevision_ATVSuitabilityField' Type='Lookup' List='DLM_Revisions' ShowField='ATVSuitabilityField'/>
    <Field Name='LastRevision_ATVTransmittal' Type='Lookup' List='DLM_Revisions' ShowField='ATVTransmittal'/>
    <Field Name='LastRevision_ATVUploadedBy' Type='Lookup' List='DLM_Revisions' ShowField='ATVUploadedBy'/>
    <Field Name='LastRevision_Created' Type='Lookup' List='DLM_Revisions' ShowField='Created'/>
    <Field Name='LastRevision_GUID' Type='Lookup' List='DLM_Revisions' ShowField='GUID'/>
    <Field Name='LastRevision_ID' Type='Lookup' List='DLM_Revisions' ShowField='ID'/>
    <Field Name='LastRevision_Modified' Type='Lookup' List='DLM_Revisions' ShowField='Modified'/>
    <Field Name='LastRevision_Title' Type='Lookup' List='DLM_Revisions' ShowField='Title'/>
    <Field Name='ATVSupersededBy_Title' Type='Lookup' List='DLM_Placeholders' ShowField='Title'/>
    <Field Name='ATVSupersededBy_ID' Type='Lookup' List='DLM_Placeholders' ShowField='ID'/>
    <Field Name='Document_ATVFileLength' Type='Lookup' List='DMS_Library' ShowField='ATVFileLength'/>
    <Field Name='Document_ATVServerRelativeUrl' Type='Lookup' List='DMS_Library' ShowField='ATVServerRelativeUrl'/>
    <Field Name='Document_ID' Type='Lookup' List='DMS_Library' ShowField='ID'/>
    <Field Name='Document_Created' Type='Lookup' List='DMS_Library' ShowField='Created'/>
    <Field Name='Confidential_Document_ATVFileLength' Type='Lookup' List='Confidential_DMS_Library' ShowField='ATVFileLength'/>
    <Field Name='Confidential_Document_ATVServerRelativeUrl' Type='Lookup' List='Confidential_DMS_Library' ShowField='ATVServerRelativeUrl'/>
    <Field Name='Confidential_Document_ID' Type='Lookup' List='Confidential_DMS_Library' ShowField='ID'/>
    <Field Name='Confidential_Document_Created' Type='Lookup' List='Confidential_DMS_Library' ShowField='Created'/>
    <Field Name='ATVLastRevision_ATVDocumentTitle' Type='Lookup' List='DLM_Revisions' ShowField='ATVDocumentTitle'/>
    <Field Name='ATVLastRevision_ATVRevision' Type='Lookup' List='DLM_Revisions' ShowField='ATVRevision'/>
    <Field Name='ATVLastRevision_ATVQAApprovalString' Type='Lookup' List='DLM_Revisions' ShowField='ATVQAApprovalString'/>
  </ProjectedFields>
  <Query>
    <OrderBy>
      <FieldRef Name=\"ATVNumberField\" Ascending=\"True\"/>
    </OrderBy>
    <Where>
      <IsNull>
        <FieldRef Name=\"ATVHideReason\"/>
      </IsNull>
    </Where>
  </Query>
  <RowLimit Paged=\"TRUE\">100</RowLimit>
</View>

marcus-atvero avatar Jul 28 '23 08:07 marcus-atvero

Any updates in this topic?

We have 2 tenants with this issue: CAML query with ProjectedFields using RenderListAsStream API from 2 weeks back.

matsla avatar Aug 07 '23 11:08 matsla

@marcus-atvero @matsla - we're looking into it. If you want to expedite the process - please, also submit a Microsoft support ticket

AJIXuMuK avatar Aug 09 '23 19:08 AJIXuMuK

Hello @AJIXuMuK Any updates in this topic? This stop working from 2 month ago.

xcomar avatar Sep 27 '23 13:09 xcomar

Any updates? same issue at some tenants and only when the using the REST API, not when using CSOM.

mdissel avatar Oct 05 '23 12:10 mdissel

The responsible team is working on the issue.

AJIXuMuK avatar Oct 13 '23 13:10 AJIXuMuK

More updates?

mdissel avatar Nov 01 '23 16:11 mdissel

More updates?

liupeng1239 avatar Mar 07 '24 09:03 liupeng1239