SharePoint / sp-dev-docs

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

ProjectedFields in the renderlistasstream API endpoint seem to have stopped working #9096

Open marcus-atvero opened 1 year ago

marcus-atvero commented 1 year ago

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

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.

ghost commented 1 year ago

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

AJIXuMuK commented 1 year ago

@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!

josergio1 commented 1 year ago

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

liupeng1239 commented 1 year ago

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

AJIXuMuK commented 1 year ago

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

marcus-atvero commented 1 year ago

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.

liupeng1239 commented 1 year ago

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.

marcus-atvero commented 1 year ago

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>
matsla commented 1 year ago

Any updates in this topic?

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

AJIXuMuK commented 1 year ago

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

xcomar commented 1 year ago

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

mdissel commented 1 year ago

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

AJIXuMuK commented 1 year ago

The responsible team is working on the issue.

mdissel commented 1 year ago

More updates?

liupeng1239 commented 9 months ago

More updates?

lenard-a commented 2 months ago

Is there any update on this?