Pnpjs: how to get only selected properties instead of all when using getFileByServerRelativeUrl

Created on 1 Apr 2019  路  1Comment  路  Source: pnp/pnpjs

I am using the following code :
I dont want listItemAllFields , i only want selected fields
url = await sp.web.getFileByServerRelativeUrl(relativeUrl).listItemAllFields.get().then((items => { return (items.ServerRedirectedEmbedUrl); }))

code answered question

Most helpful comment

Hi @harshdamaniahd,

The same exactly approach as with any other OData modified endpoints; by using select and providing comma separated string with fields: .listItemAllFields.select('Id,Created').

>All comments

Hi @harshdamaniahd,

The same exactly approach as with any other OData modified endpoints; by using select and providing comma separated string with fields: .listItemAllFields.select('Id,Created').

Was this page helpful?
0 / 5 - 0 ratings