I am currently working on an app that requires the use to upload an image using an Add Media Button and collect a signature using a Pen Input.
I am then trying to send these as attachments in an email using power automate but unsuccessfully passing the files to the flow.
Using Sendasemail.Run
Having watched various tutorial videos, the code I am using to pass the uploaded image is
{file: {contentBytes: AddMediaButton1.Media, name: AddMediaButton1.FileName}}
and then the pen input
{file_1: {contentBytes: PenInput1.Image, name: PenInput1.FileName}}
but seems to be having an issue with the FileName element. I’m trying to avoid needing to save files/signatures to a sharepoint list or similar and just want it to go straight in an email.
Any help would be greatly appreciated.
1
according to this tutorial, you should use .Name instead of .FileName:
file: {
contentBytes: Last(Self.Attachments).Value,
name: Last(Self.Attachments).Name
}
https://learn.microsoft.com/en-us/training/modules/controls-canvas-apps/upload-file
I recommend to have a Sharepoint-saved saved version of your app, just for testing/development purposes. Later you can cut off the Sharepoint to have only the emailsend part.