cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
lmheimendinger
Resolver II
Resolver II

Send email from shared mailbox with image from pen input or camera

I was quite successful at sending an email from within Power Apps that had as attachments the pen image and camera photo.  I created a collection with both images using

 

Office365Outlook.SendEmailV2("larry@techevents.com","HTML Test",HtmlText1.HtmlText,

{Attachments:

Table(

{Name:"deliveryphoto.jpg",ContentBytes: Camera1_1.Photo,'@odata.type':""},
{Name:"signature.jpg",ContentBytes: penSignature.Image,'@odata.type':""}
),
IsHTML:true}
)

 

The problem remains that instead of sending this from the logged on user in Power Apps, I want to accomplish the very same thing from a shared mailbox via Power Automate.  I am having trouble getting the attachment data passed and then using it in the send email from a shared mailbox action.

 

I tried passing the Table entry above as a parameter and set its type to Array in Power Automate (also tried as a string with just one element; same failed result).  In the Attachment section of the send email, I clicked on the icon to display the JSON code, and then replaced it with the dynamic data array value.  However, when I tried to save the flow, I get an error  that ends with this:

 

 'emailMessage/Attachments' with type/format 'String' is not convertible to type/format 'Array'.

 

I know the variable is initialized as a  type array, and this happens as I am creating the flow well before evoking it from Power Apps.

 

Perhaps I can just ignore all I have done to get this to work and instead ask the question I really need answered:

 

I have a pen captured image and a camera photo in Power Apps.  I need to email those as attachments from a shared mailbox.

 

  1. How do I pass those as parameters from Power Apps to Power Automate, i.e., is it a string, an array (table). a JSON function, or something else?
  2. On the Power Automate side, how do I accept the parameter and then define it as an attachment in the send email action?  I know the JSON format for Power Apps send email does what I want, but how do I connect the two platforms so I can send from a shared mailbox?

 

Thanks to all who can help with a detailed response.

1 ACCEPTED SOLUTION

Accepted Solutions
lmheimendinger
Resolver II
Resolver II

I managed to hack my way through this.  Here's how.

 

1. I am capturing the signature and photo in a SharePoint list as hyperlink columns.  When the list is viewed, the URL for where they are actually stored is visible.  But I still needed to do something; stay tuned.

2. From Power Apps, I am, passing parameters - to and cc addresses, HTML body text, and the signature and photo image.

3. I needed the URL for these as string values, so I had to set a variable as

 

Text(imagefield) rather than just imagefield.  Very important.

 

Now shift to Power Automate.

 

  1. First use Power Apps as trigger.
  2. Then initialize a variable (string) for each passed parameter.
  3. Next, use Get Metadata and specifically for SharePoint file path.
  4. Do the same for Get File content, and I repeated for photo as well as pen image.
  5. Now send email from shared email box.

lmheimendinger_0-1623114248365.png

 

But there is a bug if you just do these things.  The file path from Text(imagefield) also contains

 

"https://sharepoint...." though the site when what you need for the file path is just the portion for the list name and file name.  In Power Apps, I used Substitute() to set that portion to null or "" and then perfect results.

 

Emails from shared mailbox now show up as proper images.

 

 

View solution in original post

2 REPLIES 2
lmheimendinger
Resolver II
Resolver II

I managed to hack my way through this.  Here's how.

 

1. I am capturing the signature and photo in a SharePoint list as hyperlink columns.  When the list is viewed, the URL for where they are actually stored is visible.  But I still needed to do something; stay tuned.

2. From Power Apps, I am, passing parameters - to and cc addresses, HTML body text, and the signature and photo image.

3. I needed the URL for these as string values, so I had to set a variable as

 

Text(imagefield) rather than just imagefield.  Very important.

 

Now shift to Power Automate.

 

  1. First use Power Apps as trigger.
  2. Then initialize a variable (string) for each passed parameter.
  3. Next, use Get Metadata and specifically for SharePoint file path.
  4. Do the same for Get File content, and I repeated for photo as well as pen image.
  5. Now send email from shared email box.

lmheimendinger_0-1623114248365.png

 

But there is a bug if you just do these things.  The file path from Text(imagefield) also contains

 

"https://sharepoint...." though the site when what you need for the file path is just the portion for the list name and file name.  In Power Apps, I used Substitute() to set that portion to null or "" and then perfect results.

 

Emails from shared mailbox now show up as proper images.

 

 

View solution in original post

Hi,

 

Thanks for your follow up post! I am glad that you were able to get this figured out. Hopefully this will prove useful for future communities users who are having similar issues.

 

Regards,

 

Alex

 

-------

 

Community Support Team _ Alex Rezac
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,602)