I need to get all the versions of the files in a SharePoint Library for the past 3 years.
This flow was working before but since yesterday stopped with a 400 Error.
My flow steps are as follows:
1) Get all files from the SharePoint Library
2) loop through all the files
3) "Send an HTTP request to SharePoint" to get all the versions with the id of the file with the URI:
_api/web/lists/getByTitle('Library')/items(864)/Versions
4) Parse JSON and loop through all the versions sending a request to SharePoint again to get the version information with the URI:
_api/web/lists/getByTitle('Library')/items(864)/Versions(101)
5) Make another call "Send and HTTP request to SharePoint' to get the contents of the file with the following URI:
/_api/web/GetFileByServerRelativeUrl('/sites/PnP/<Library>/<file name>.docx')/Versions(101)/$value - the /$value is/was giving me the contents of the file up until yesterday and now it is throwing a 400 error. Nothing has changed in the flow or in the data.
6) Create a file in OneDrive
7) Copy the file to SharePoint
8) Update the metadata in the SharePoint document with the information from the previous steps.
Step 5 is throwing the following error:
{
"message": "Cannot write the value 'null' in raw format.\r\nclientRequestId: b9e851be-0862-4861-ab75-afd062411a89\r\nserviceRequestId: ce5b85a1-9047-0000-8053-9e555aba28ea",
"status": 400,
"source": "https://windsorcommunitieseo.sharepoint.com/sites/PnP/_api/web/GetFileByServerRelativeUrl('/sites/PnP/<library>/<file name>.docx')/Versions(101)/$value",
"errors": [
"-1",
"Microsoft.Data.OData.ODataException"
]
}