BadRequest in Power Automate while the attachment is uploaded to Sharepoint - forms

I am setting up a flow in Power Automate to retrieve details from a Microsoft Form.
What it does:
Get the reponse details from Microsoft Forms
Creating a new item in a Sharepoint list
If one of the questions is answered with yes, the following will run:
Parsing JSON
Get the file content and metadata using path
Add attachment to Sharepoint in the list
Get the items
Add the same attachment to a database folder in a Sharepoint folder
It goes wrong in the last step where I have some "apply to each"-statements. Somehow it does save the file to the correct folder, but it does give an error in the flow itself. I have read multiple forums regarding this problem, but it does not seem to solve mine.
Update:
I was able to clear up the error in the end. However, the "Apply to each" still gives an error. The file has been updated in the folder.
Apply to each runs, but still gives error
Please help :(!

Related

WOPI corrupting files on edit

I have a WOPI host running in a Blazor server application with all of the .wopitest tests passing for the desired functionality (others skipped).
When I upload a word document, I am able to view the document with no issues. I am also able to edit the document, however when I try and edit the document a second time, I get an error.
The error doesn't appear to be handled and seems to originate in the Office online javascript file.
Error on attempting second edit
Following the error, I am still able to open the document for viewing. It is the same behaviour if I use the 'Editing' button in the Office Online page or directly navigate to the editing page using an edit action url.
Supplementary information:
Using ngrok to debug locally
.NET 6
Using SQLite database for holding file information (including path to file)
Using local folders for storing file contents (e.g. 'data' folder containing all files)
Similar issues with .xslx files beign corrupted upon editing and requiring a 'repair' when opened with Excel. This repair removes cells containing text and indicates that it removes the theme.
Viewing a word document gives the following console errors View document error
The first editing of a word document gives the following console errors Edit document error
I was expecting to be able to repeatedly edit the document.
I tried opening the file in the Desktop version of Word and got the following error Desktop Word recover
Following a recover, the document appears to work as expected in Word (desktop) but still won't open for editing through WOPI.
Turns out it was the way the POST http request body was being saved.
Still not certain what was going wrong but somewhere along the way of writing the stream into a buffer and then saving that to a file corrupted the file.
I suspect the file stream was either truncating or adding a few bytes.
The interesting part being that Office Online was still able to view the file.
This indicates there is some tolerance for malformed files still being served.

H5P content error - on trying to edit in Moodle

In Moodle, I created a new H5P "activity", and then uploaded a reusable template of the crossword from the H5P site. On trying to open the settings and EDIT the content of this crossword (and also the essay writing feature), I got the following error:
**The given URL is incorrect or you cannot edit this file.
More information about this error**
Following the link gave the following error on the moodle forums:
error/core h5p/error:emptycontentid
It has worked in the past and works with certain H5P content types, so I am unsure as to why this edit error is occurring. I've posted on Moodle/H5P forums which aren't terribly active so hoping for some answers here!
It may seem silly, but took me a while to figure it out. I had simply uploaded the same file and it doesn't allow the same file name. This was what was causing the error.

Is it possible with PowerShell to find an author in Sharepoint and change it?

A little more context, I'm trying to use PowerShell to search through SharePoint for any files which have a particular Author.
We have an issue where if someone tries to delete a file that is authored by an ex-employee it alerts a different person that they did not have permission for the file to go to recycle bin for some reason and makes them permanently delete it instead. Below is a link of what they get:
Microsoft won't support it as they say they won't supply custom scripts so I was wondering if anyone here had any ideas?

Power Automate - Flow Fails InvalidTemplate- When trying to save attachment to Sharepoint Using Create File

Here is what I am trying to do:-
I want to create a work item in Azure DevOps when an email arrives in my inbox. If the email has an attachment, I want to save that attachment in the SharePoint site folder, retrieve the link of the created file, and update the work item description with the file link.
I have created the flow but when testing, here is what the exception is coming
I am sending this email from Gmail to my organization account. I have researched this problem in existing threads at the Power Automate community as well, but nothing seems to be fit as a potential solution to this problem. Your help in this regarding is highly appreciated.
Thanks.
I resolved this issue by creating a new flow, in this case, please make sure, you are updating the configuration of outlook email to say "Include Attachments" - "yes".
Please refer to screenshot below
If you will not include it, it will be treated as null, when you will be trying to create a file at SharePoint using power automate.
Hope this helps everyone.
Thanks,
Bee

Access file content within an Azure Dev Ops/VSTS artifact using REST API

I am looking to get the contents of a file I pushed as an artifact to Azure DevOps
I was able to get a json response with a URL to the artifact zip by using this API
https://dev.azure.com/uifabric/cd9e4e13-b8db-429a-9c21-499bf1c98639/_apis/build/builds/8838/artifacts?artifactName=drop&api-version=5.0
However, what I really want is the contents of a file called bundlesizes.json within this zip.
I did come across the Get File API here which mentions an API as follows
GET https://dev.azure.com/{organization}/{project}/_apis/build/builds/{buildId}/artifacts?artifactName={artifactName}&fileId={fileId}&fileName={fileName}&api-version=5.0
I tried replacing it as follows
https://dev.azure.com/uifabric/fabricpublic/_apis/build/builds/8838/artifacts?artifactName=drop&fileId=bundlesizes.json&fileName=bundlesizes.json&api-version=5.0
However, I get this error
I think what I am missing is the fileId field, where I am not aware what needs to go in. The documentation says fileId is the The primary key for the file. However, I don't know where I can find it.
Microsoft doesn't have complete documentation on how to get FileID.
You can take a different approach and download the file using below API. You can get the ContainerID through GET build details.
https://collectionurl/tfs/defaultcollection/_apis/resources/Containers/${containerid}?itempath=drop