Hi,
I use an attachmentcontrol to have users select a file and save it to sharepoint
Code in onaddfile:
(Based on a video I saw from Sean Young. My change: insert a bit of guid in the filename to prevent doubles.)
Set(VarDemoFromAttachmentControl;JSON(Image8.Image;JSONFormat.IncludeBinaryData))
;;UpdateContext({FileGUID:Right(GUID();6)})
;;Set(VarImage;Image8.Image)//
;;Set(Base64Only;Mid(VarDemoFromAttachmentControl;Find(",";VarDemoFromAttachmentControl)+1;Len(VarDemoFromAttachmentControl)-Find(",";VarDemoFromAttachmentControl)-1))
;;Set(VarFileName;Last(AttachmentControl.Attachments).Name & FileGUID & "." & Last(Split(First(AttachmentControl.Attachments).Name; ".")).Result)
;;UpdateContext({lOmschrijving:VarFileName})
;;Set(VarFileLink;PowerAppsToSharePoint_3.Run(Last(AttachmentControl.Attachments).Name & FileGUID & "." & Last(Split(First(AttachmentControl.Attachments).Name; ".")).Result;Base64Only).sharepointfilelink)
;;Reset(AttachmentControl)
;;Reset(TextInput8)
This is working for almost a year with no problem. I am the owner of the sharepoint site all is stored.
It now has stoppped working when I am the user.
-both with my latest build and with the version published to everyone (evryone except me has no problem)
-on any pc, in any browser
-on an iphone it DOES still work, logged in as me
If I ran the code once in the editor I get the following error dot with my attachment control:
error message
Sorry about the image format but powerapps does not allow me to copy paste thet text.
Edit 14-3
When I revert to an older version it does work. It seems that someone else opening the app and myself opening the app in stead of editing it does not mean the vesrions are the same.
Reading back on "bad gateway" errors from other user I do not find solutions, only revert and hope it never happens again.
So my next powerapps day will be reconstructing changes in stead productive alas.
Anyone knows what is going on?