cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
nagaraj007
Helper V
Helper V

Need to attach photo in Email

Hi, 

I am very new to Flow. I am able to build the normal flow when there is line item added to SQL. I have powerapps wherein i have picked data of photo and signature to the SQL database. Attached the sql database output table.

 

Now i want the email to show in the attachments both photo and signature. 

Could anyone help me with regards to this.

 

I have also attached the flow for your reference.flow.pngvisitor photo and signature.png

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @nagaraj007,

Sorry for the delay in my response.

A workaround you could try and implement would be to embed the base 64 picture into the e-mail body. You have this community post here to see how it is done: https://powerusers.microsoft.com/t5/General-Power-Automate/insert-picture-outlook-body-message/td-p/...

If this is getting urgent and impacting your business I believe it would be better for you to raise a support request through https://admin.powerplatform.microsoft.com/support so this can be troubleshooted in more depth.

 

Hope this helps!

 

Best regards,

Ricardo

View solution in original post

10 REPLIES 10
nagaraj007
Helper V
Helper V

The expression i have used for replace is as follows and i get error message stating wrong expression.

 

replace(triggerBody()?[VisitorPhoto],'data:image/jpeg;base64,/','/')

Could anyone help me.
rimatos
Microsoft
Microsoft

Hi @nagaraj007,

 

I just performed a quick test on my side and I validated that you cannot use the dynamic content from your SQL trigger, directly into the replace function inside the compose.

 

To do so, you will need to do the following:

 

  1. Initialize variable - First you will need to initialize a string variable where you will store the value from your SQL trigger (VisitorPhoto).
  2. Compose -In here you will be able to store the result of your replace function. Assuming you call your variable lets say "ReplaceString" you would have an expression similar as this one:
replace(variables('ReplaceString'),'data:image/jpeg;base64,/','/')

 

An example of my flow can be seen bellow:

image.png

 

 

Do take into account that the replace function is case-sensitive, as described in our documentation

 

 

Hope this helps!

 

Regards,

Ricardo

Hi,

 

I was able to run the flow for replace function. However i am getting the error in email when i am trying to attach the photo.

 

I have added the attachement content of base to binary64 output.

 

I have attached screensnip for your reference.

 

I am getting error as Attachment cannot be null or empty.

 

 

error.png

Hi,

 

Even the input and output is blank. Please advise.error1.png

Hi ,

 

I am getting new error in the REPLACE FUNCTION. After running the below function both input and output RESULT is same. Based on this BASE64TOBINARY GETTING ERROE.error3.png

 

replace(variables('Visitor Photo'),'data:image/png;base64,/','/')

Hi @nagaraj007,

 

In the replace function the output of the Compose action is expected. In my example I put my name "Ricardo Matos", and in the function i substitute my last name with "Miguel" as seen bellow.

 

image.png

 

 When looking at the result of the Compose action i receive this:

 

image.png

 

As for the attachment. Try and place the output from the first Compose action instead of converting it to binary and see if it works.

 

 

Hope this helps!

 

Regards,

Ricardo

Hi,

 

I am getting error even now. Please find the attached error screen,

 

My aim is to show the visitor photo in the email.error34.png

Could any one please help me in this regard. This request is very urgent.  I saw the this link and want to replicate the same to attach the photo in the email. But i am unable to do that. Please advise.

 

https://social.technet.microsoft.com/wiki/contents/articles/52492.microsoft-flow-build-a-mobile-powe...

Hi @nagaraj007,

Sorry for the delay in my response.

A workaround you could try and implement would be to embed the base 64 picture into the e-mail body. You have this community post here to see how it is done: https://powerusers.microsoft.com/t5/General-Power-Automate/insert-picture-outlook-body-message/td-p/...

If this is getting urgent and impacting your business I believe it would be better for you to raise a support request through https://admin.powerplatform.microsoft.com/support so this can be troubleshooted in more depth.

 

Hope this helps!

 

Best regards,

Ricardo

View solution in original post

Helpful resources

Announcements
MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Users online (38,891)