Using flow to insert data and attachments from Power Apps web part to document library. For some users, the flow is corrupting attachments when uploading, and when I try to open, I get this message: “Hmm… looks like this file doesn’t have a preview we can show you.”
In my Power App, here’s the code that I use to send to the flow:
ForAll(myUploadAttachment.Attachments,
myUploadComposePAV2.Run(
UploadTitleTextBox.Text,
YearDropDown.Selected.Value,
MonthDropDown.Selected.Value,
CurrentUserTextBox.Text,
{
file: {
contentBytes: Value,
name: Name
}
}
)
);
In my Power Automate flow, I have the following:
- PowerApps (V2): List all my inputs. Including “File Content”
- Create File: I have my Site Address, Folder Path, File Name = file.name, File Content= File Content
- Update file properties: I have my Site Address, Library Name, id = Itemid, Uploaded Title= UploadedTitle, Year Value = Year, Month Value = Month, Uploaded By: Uploaded By
- Respond to a PowerApp or flow
Again, the corruption is caused by some users, but not all.