Announcements
I am developing the app which automatically sends e-mail using collected data in the app IN POWER APPS.
To send an e-mail I use MyFlowPowerAutomate.Run("recipient@host.com", "E-mail subject", MyEmailBody.HtmlText).
MyEmailBody is an HTMLtext display item of Power Apps. Collecting the data from the app I develop an e-mail body. The e-mail body is constructed based on certain conditions. Everything works well, but Images.
The e-mail should contain images embedded in e-mail body (not as attachments). It is very similar to the process when you manually paste copied image in the e-mail body.
I have images stored in the sharepoint list Image type column. Each image can be accessed either by storing it in the Image input in the app or via the same Power Fx query from the list: First(MySharepointList, ID = MyId_1)).Image
I have tried to use <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA..."> in different ways including in HTML text, though it didn't work. I generated the sequence using JSON() function: JSON(MyImage1.Image, JSONFormat.IncludeBinaryData).
I also used an URL link of the image stored in sharepoint instead of an encoded image, though it was coming as a sequence of something like this: appres://datasources/My%20list/table/9d6710d0-1e99-455a-a126-db25f323f6ed/rows/9/reference/https:%2F%2Feurope-001.azure-apim.net%2Fapim%2Fsharepointonline%2F14364aecf82c4a61bb59ba3656a94408%2Fdatasets%2Fhttps%25253a%25252f%25252ftauindustrialrobotics.sharepoint.com%25252fsites%25252fproduction.report%2Fcodeless%2F_api%2Fv2.1%2Fsites%2F06762788... However, in the app the use of URL showed the image, but when sending it didn't work.
I also used encoded image in the Power Automate Flow: MyFlowPowerAutomate.Run("recipient@host.com", "E-mail subject", MyEmailBody.HtmlText & "<img src=<my_encoded_image>""" """>"), though there was no success.
Are there some ways to embed an image in HTML text in the Power Apps so that it would be sent embedded t?
ClearCollect(
colEncodedChars;
{
Encoded: "%25253a";
Decoded: ":"
};
{
Encoded: "%25252f";
Decoded: "/"
};
{
Encoded: "%2F";
Decoded: "/"
};
{
Encoded: "%21";
Decoded: "!"
};
{
Encoded: "%3F";
Decoded: "?"
}
);
ClearCollect(
colDecodedChars;
$"https{ Last(ForAll(Split(ThisItem.Foto.Full; "https"); {Result: ThisRecord.Value})).Result }"
);;
ForAll(
colEncodedChars As EncodedCharItem;
Collect(
colDecodedChars;
Substitute(
Last(colDecodedChars).Value;
EncodedCharItem.Encoded;
EncodedCharItem.Decoded
)
)
);;
If(Last(colDecodedChars).Value = "https"; Blank(); Last(colDecodedChars).Value)
concat(json(body('Send_an_HTTP_request_to_SharePoint')?['d']?['Foto'])?['serverUrl'], json(body('Send_an_HTTP_request_to_SharePoint')?['d']?['Foto'])?['serverRelativeUrl'])
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.