cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
aldenniklas
Level: Powered On

Sending images via Microsoft Flow app button

I created a Flow that is triggered from an app button. If I choose to include the "file attachment" option the user is able to attach a file or use the built in camera. However, any images taken with the camera are uploaded as a byte stream instead of a picture.

 

I would like to convert the byte stream into a .jpeg or .png and attach it to an email, any suggestions?

If it is possible it would also be great if it could be compressed on the way instead of attaching a full sized 3mb picture.

 

Thanks!


Accepted Solutions
Community Support Team Rank
Community Support Team

Re: Sending images via Microsoft Flow app button

Hi @aldenniklas,

 

Could you provide the specific details of your app?

It seems that you want to change the format of the image uploaded by the user.

I did the test on my side, instead of using the PowerApps button, I used the button inside Flow directly, asking the user to select a local file.

The file content is also passed as contentBytes.

3.PNG

If you can get the contents of the file and the name of the file, you could try changing the extension of the file when configuring Send an email-Attachment.

If you can get the file name with extension, you could first remove the file's extension, and then use the concat() function to add the ".png/.jpeg".

To remove extensions, you could refer to such an expression:

replace(‘filename’,concat('.',last(split(‘filename’,'.'))),'')

The configuration of Send an email is as below:

4.PNG

Please take a try if it helps.

 

Best Regards,

Barry


All Replies
Community Support Team Rank
Community Support Team

Re: Sending images via Microsoft Flow app button

Hi @aldenniklas,

 

Could you provide the specific details of your app?

It seems that you want to change the format of the image uploaded by the user.

I did the test on my side, instead of using the PowerApps button, I used the button inside Flow directly, asking the user to select a local file.

The file content is also passed as contentBytes.

3.PNG

If you can get the contents of the file and the name of the file, you could try changing the extension of the file when configuring Send an email-Attachment.

If you can get the file name with extension, you could first remove the file's extension, and then use the concat() function to add the ".png/.jpeg".

To remove extensions, you could refer to such an expression:

replace(‘filename’,concat('.',last(split(‘filename’,'.'))),'')

The configuration of Send an email is as below:

4.PNG

Please take a try if it helps.

 

Best Regards,

Barry

aldenniklas
Level: Powered On

Re: Sending images via Microsoft Flow app button

Thanks for the reply!
I am using the Flow app button so it's the same method you are using.

It's quite embarassing but the problem was caused by me not adding ".jpg" in the "Attachments Name" field.

It works great now even though I would love for the file to be compressed as well.

Thanks!
>