web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Out of memory error wh...
Power Apps
Unanswered

Out of memory error while upload photo to Sharepoint list from smartphone

(0) ShareShare
ReportReport
Posted on by 181

Hi all,

I want to upload 14 photos which choose from Smartphone gallery to Sharepoint list image column but it causes out of memory error. 

It is fine that upload 5 photos.

May i know is there has limitation for upload photo? or that have any method to reduce the size of photo?

Thank you very much for your help.

Below is my code:

 

Set(varImage,JSON(Image2_1.Image,JSONFormat.IncludeBinaryData));
Set(varImage2,JSON(Image4_1.Image,JSONFormat.IncludeBinaryData));
Set(varImage3,JSON(Image5_1.Image,JSONFormat.IncludeBinaryData));
Set(varImage4,JSON(Image7_1.Image,JSONFormat.IncludeBinaryData));
Set(varImage5,JSON(Image6_1.Image,JSONFormat.IncludeBinaryData));
Set(varImage6,JSON(Image8_1.Image,JSONFormat.IncludeBinaryData));
Set(varImage7,JSON(Image9_1.Image,JSONFormat.IncludeBinaryData));
Set(varImage8,JSON(Image10_1.Image,JSONFormat.IncludeBinaryData));
Set(varImage9,JSON(Image14_1.Image,JSONFormat.IncludeBinaryData));
Set(varImage10,JSON(Image11_1.Image,JSONFormat.IncludeBinaryData));
Set(varImage11,JSON(Image12_1.Image,JSONFormat.IncludeBinaryData));
Set(varImage12,JSON(Image13_1.Image,JSONFormat.IncludeBinaryData));
Set(varImage13,JSON(Image15_1.Image,JSONFormat.IncludeBinaryData));
Set(varImage14,JSON(Image16_1.Image,JSONFormat.IncludeBinaryData));

Office365Outlook.SendEmailV2(
"alan@abc.com.hk",// To
"New:  e-Inspection Report of PO:" & DataCardValue14_1.Text & " Date:" & DataCardValue10_1.SelectedDate,// Subject
"Dear Sirs," &"<br> The Site e-inspection Report is attached and pasted as below for your reference." & "<br> Thank." & "<style>
table, th, td {
border: 1px solid gray;
border-collapse: collapse;
}
</style>" &
"<table><tr><th>" &"Date" &"</th><th>" &DataCardValue10_1.SelectedDate &"</th></tr>" &
"<tr><td>"&"Zone"&"</td><td>"&DataCardValue11_1.Selected.Value &"</td></tr>" &
"<tr><td>"&"Contractor"&"</td><td>"&DataCardValue12_1.Selected.Value &"</td></tr>" &
"<tr><td>"&"Location"&"</td><td>"&DataCardValue13_1.Text &"</td></tr>" &
"<tr><td>"&"PO number"&"</td><td>"&DataCardValue14_1.Text &"</td></tr>" &
"<tr><td>"&"Inspector"&"</td><td>"&DataCardValue15_1.Selected.Value &"</td></tr>" &
"<tr><td>"&"Inspector photo"&"</td><td>"&"<img src=" &varImage & " >" &"</td></tr>" &
"<tr><td>"&"Active or non-active site"&"</td><td>"&DataCardValue39_1.Selected.Value &"</td></tr>" &
"<tr><td>"&"Work Type"&"</td><td>"&DataCardValue40_1.Selected.Value &"</td></tr>" &
"<tr><td>"&"RE"&"</td><td>"&DataCardValue41_1.Selected.Value &"</td></tr>" &
"<tr><td>"&"PE"&"</td><td>"&DataCardValue42_1.Selected.Value &"</td></tr>" &
"<tr><td>"&"PWRA front photo"&"</td><td>"&"<img src=" &varImage2 & ">" &"</td></tr>" &
"<tr><td>"&"PWRA back photo"&"</td><td>"&"<img src=" &varImage3 & ">" &"</td></tr>" &
"<tr><td>"&"form4"&"</td><td>"&"<img src=" &varImage4 & ">" &"</td></tr>" &
"<tr><td>"&"site situation "&"</td><td>"&"<img src=" &varImage5 & ">" &"</td></tr>" &
"<tr><td>"&"good1"&"</td><td>"&DataCardValue43_1.Text &"</td></tr>" &
"<tr><td>"&"good1photo"&"</td><td>"&"<img src=" &varImage6 & " >" &"</td></tr>" &
"<tr><td>"&"good2"&"</td><td>"&DataCardValue44_1.Text &"</td></tr>" &
"<tr><td>"&"good2photo"&"</td><td>"&"<img src=" &varImage7 & " >" &"</td></tr>" &
"<tr><td>"&"good3"&"</td><td>"&DataCardValue45_1.Text &"</td></tr>" &
"<tr><td>"&"good3photo"&"</td><td>"&"<img src=" &varImage8 & " >" &"</td></tr>" &
"<tr><td>"&"Improvement1"&"</td><td>"&DataCardValue46_1.Text &"</td></tr>" &
"<tr><td>"&"Improvement1photo"&"</td><td>"&"<img src=" &varImage10 & " >" &"</td></tr>" &
"<tr><td>"&"Improvement2"&"</td><td>"&DataCardValue47_1.Text &"</td></tr>" &
"<tr><td>"&"Improvement2photo"&"</td><td>"&"<img src=" &varImage11 & " >" &"</td></tr>" &
"<tr><td>"&"Improvement3"&"</td><td>"&DataCardValue48_1.Text &"</td></tr>" &
"<tr><td>"&"Improvement3photo"&"</td><td>"&"<img src=" &varImage12 & ">" &"</td></tr>" &
"<tr><td>"&"Rectified1"&"</td><td>"&"<img src=" &varImage9 & ">" &"</td></tr>" &
"<tr><td>"&"Rectified2"&"</td><td>"&"<img src=" &varImage13 & ">" &"</td></tr>" &
"<tr><td>"&"Rectified3"&"</td><td>"&"<img src=" &varImage14 & ">" &"</td></tr>" &
"</table>" & "<br> Dear Contractor," & "<br> Please refer to the report and rectify the defect(s) and provide Photo(s) to us for update by 2 business days." &"<br>Thanks.",
{Attachments: Table(
{
Name: "submittedInspection.pdf",
ContentBytes: PDF(EditForm1_1, {ExpandContainers: true})
}
)
}
);
SubmitForm(EditForm1_1);

Categories:
I have the same question (0)
  • Michael E. Gernaey Profile Picture
    53,315 Super User 2025 Season 2 on at

    Hi @AT_AlanTse123 

     

    Firstly, you say upload, which I thought you meant to a file location, but it appears your are trying to Email them in a table,

     

    So respectively it's the phone + other things that contribute to the limit. However, what I see is that you are essentially doubled+ the memory from these Images because you are creating variables to store another copy. I would avoid that.

     

    What I would instead do, is create a storage location somewhere, (somewhere you can share the images to customers), upload them 1 by 1 to that location and then get a URL, to put in the Table so that it loads the image when they get the email, not literally creating a variable that doubles your memory and then putting them in the Email table, which makes it use even more memory.


    Cheers
    If you like my answer, please Mark it as Resolved, and give it a thumbs up, so it can help others
    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

     

     

  • AT_AlanTse123 Profile Picture
    181 on at

    Hi @FLMike ,

    Thank you for your reply and advice.

    My upload is mean upload photo to sharepoint list image column and i want to issue email after i submit the form.

    I found memory not enough may be the reason of crashing app and the format of photo is not compatiable with image column format as the photo is HEIC not JPEG. Hence i will change the format of photo and try again.

     

    Thank you.

     

     

  • Verified answer
    Michael E. Gernaey Profile Picture
    53,315 Super User 2025 Season 2 on at

    Hi @AT_AlanTse123 

     

    But I am looking at your code and its doing everything I was saying you should not do. I do not see uploading to SharePOint here at all, I just see you doing

    14 Sets to variables (dont do that)

    Then 14 embedded images in that Table in the Email (dont do that), use URL links

    That is what is causing your OOF Memory issue, regardless of the fact that the image isn't a format it understands. 

     

    Your overall design is flawed.


    Cheers
    If you like my answer, please Mark it as Resolved, and give it a thumbs up, so it can help others
    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

  • AT_AlanTse123 Profile Picture
    181 on at

    Hi @FLMike ,

     

    The code i revised that i just send the email attach PDF document only and remove 14 set variables.

    The Submitform is for my sharepoint list called  DC E logbook & Inspection.

    AT_AlanTse123_0-1696484887088.png

     

    Office365Outlook.SendEmailV2(
    "alan@abc.com.hk",// To
    "New: CLPeS e-Inspection Report of PO:" & DataCardValue14_1.Text & " Date:" & DataCardValue10_1.SelectedDate,// Subject
    "Dear Sirs," &"<br> The Site e-inspection Report is attached and pasted as below for your reference." & "<br> Thank." &"<br> Dear Contractor," & "<br> Please refer to the report and rectify the defect(s) and provide Photo(s) to us for update by 2 business days." &"<br>Thanks.",
    {Attachments: Table(
    {
    Name: "submittedInspection.pdf",
    ContentBytes: PDF(EditForm1_1, {ExpandContainers: true})
    }
    )
    }
    );
    SubmitForm(EditForm1_1);

     

    Thank you very much

  • Michael E. Gernaey Profile Picture
    53,315 Super User 2025 Season 2 on at

    Hi @AT_AlanTse123 

     

    Is the memory error gone now?

     

    If it is, and my response helped, please select Resolved on my answer. Thanks!

     

    @AT_AlanTse123  appreciate the Kudo, but if you can mark the Answer itself as resolved it will help others too

     

  • AT_AlanTse123 Profile Picture
    181 on at

    It sometimes gone error but i reopen the power app and close other application, it works.

    Thank you very much for your help.

    I will mark as solution.

    Thank you

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 793 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 333 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard