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

Getting File Version Custom Fields

Open samer1977 opened this issue 1 year ago • 2 comments

What type of issue is this?

Question

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

SharePoint REST API

Target SharePoint environment

SharePoint Online

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

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

Additional environment details

  • browser version
  • SPFx version
  • Node.js version
  • etc

Issue description

Hi Guys,

I need to get whatever equivalent to the file ListItemAllFields ,ListItemAllFields/FieldValuesAsText but for file version. I tried something like this:


versions = file.versions.expand(["ListItemAllFields","ListItemAllFields/FieldValuesAsText","Fields"]).get()
 ctx.load(versions)
 ctx.execute_query()

but its not returning anything besides the system properties.

For files the following works and I get all fields:

 files = list_source.files.expand(["ListItemAllFields","ListItemAllFields/FieldValuesAsText"]).get()    
 ctx.load(files)
 ctx.execute_query()

Can you please help Thanks

samer1977 avatar Feb 18 '24 03:02 samer1977

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

ghost avatar Feb 18 '24 03:02 ghost

@VesaJuvonen ,

Any update on this ? please let me know

samer1977 avatar Feb 21 '24 09:02 samer1977