Forum Discussion
Getting version history from SharePoint document library
Hi all,
I posted a similar issue a whileback but thought I'd try again and phrase myself a little differently.
I want to use previous versions of a file I have in Sharepoint.
The way I am currently trying uses the REST API to return a list of versions and their URL, which links directly to the content. The Url looks like this:
mysite.sharepoint.com/_vti_history/[version]/[path]
This URL does exactly what I need, but when I try to load it with Web.Contents(), it amends the url to something that doesn't work:
mysite.sharepoint.com/_api/web/GetFileByServerRelativeUrl('_vti_history/[version]/[path]')/$value
I am aware that for regular files this would be fine. For previous versions, it isn't.
Does anyone know how I can either tell PowerBi to *not* change my Url, or how else I can get previous versions without using a custom connector?
4 Replies
- v-diye-msftCommunity Support
Hi omeallynile
You can try to use web connector with 'relativepath' option:
let Source = Web.Contents("https://tenant.sharepoint.com", [Headers=[#"key"=mykey], RelativePath="/_api/GetFileByServerRelativeUrl('[path]')/$value"]) in Source- omeallynileFrequent Visitor
Hi v-diye-msft ,
Thanks for responding. As mentioned in OP, this does not work when calling from version history. It only works for the current version of a file. Do you have any other ideas?
- v-diye-msftCommunity Support
Hi omeallynile ,
Sorry I won't know, please kindlty raise your problem to support team for more advice:
https://powerbi.microsoft.com/en-us/support/