0

RenderListDataAsStream is not returning some fields specified in ViewFields.

I need to retrieve ServerRedirectedEmbedUrl but doesn't return anything.

If I run the following CAML Query specifying the name of the fields to retrieve then ServerRedirectedEmbedUrl doesn't returns.

<View Scope='RecursiveAll'>
  <Query>
    <Where>
     <Eq>
       <FieldRef Name='ID' />
       <Value Type='Integer'>100</Value>
     </Eq>
   </Where>
  </Query>
  <ViewFields>
    <FieldRef Name='Title' />
    <FieldRef Name='ServerRedirectedEmbedUrl' />
  </ViewFields>
  <RowLimit Paged="TRUE">1</RowLimit>
</View>

If I run the same CAML Query without ViewFields then ServerRedirectedEmbedUrl returns.

<View Scope='RecursiveAll'>
  <Query>
    <Where>
     <Eq>
       <FieldRef Name='ID' />
       <Value Type='Integer'>100</Value>
     </Eq>
   </Where>
  </Query>
  <RowLimit Paged="TRUE">1</RowLimit>
</View>

I run these queries using PnP.js in a spfx web part against Sharepoint Online. Also I have a library with more than 5000 files.

Other fields like serverurl.progid (aka File/ServerRedirectedURL) have the same behavior.

How can I retrieve these fields using RenderListDataAsStream? What I'm missing?

1 Answer 1

0

In your code, you need to reference the field like this:

const x = item["serverurl.progid"] 

instead of:

const x = item.serverurl.progid

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.