I have been trying for a while to develop a “simple” attachment button in MS Power Apps that I can use in my sharepoint site that will (when pressed) attach files to a location created in sharepoint. This button should open a file explorer window (which it does), allow you to select a file and move the file to a location in sharepoint using flow (MS Power Automate . Will you look at this code highlighted below and tell me if you see something that looks off? It is not moving the file to my sharepoint location (no error, nothing).
……………………
AttachmentControl = Name of the Attachment Control that I am developing
EasyUpload = Name of the Flow I created to move the attached file to sharepoint
VarDemoFromAttachmentControl = Variable to hold the file contents (Type of file and encoding)
VarBase64Only = Variable to hold the file encoding only
…………………………
OnAddFile:
Set(varDemoFromAttachmentControl, JSON(Image2.Image, JSONFormat.IncludeBinaryData));
Set(varBase64Only, Mid(varDemoFromAttachmentControl, Find(",", varDemoFromAttachmentControl)+1, Len(varDemoFromAttachmentControl) - Find(",", varDemoFromAttachmentControl) -1));
Set(varFileLink, EasyUpload.Run(Last(AttachmentControl.Attachments).Name, varBase64Only).sharepointfilelink);
Reset(AttachmentControl)