Code review in PowerApps

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)

Hey there,

nice to meet you! :slightly_smiling_face:

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor ( </> ) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).