Skip to main content

Notifications

Power Apps - Power Apps Pro Dev & ISV
Unanswered

Intermittent Issue with Patching Images to SharePoint in PowerApps - Corrupted Images

(0) ShareShare
ReportReport
Posted on by 8

Hi everyone,

I'm experiencing an intermittent issue with patching images to SharePoint from my PowerApps app. My setup allows users to upload up to 8 images at a time in a custom form, and I'm using the Patch function to save these images to a SharePoint library.

The process works was working correctly for the first few months and now correctly at times, but often, the images seem to get corrupted in SharePoint. They appear to upload (as the image files show up in the library), but when I try to view them, they are either incomplete, blank, or unviewable. I haven’t identified a consistent pattern in when it fails versus when it works.

Has anyone encountered this issue before? Could there be a specific cause for this random image corruption when patching to SharePoint, or are there best practices I should be following to ensure image integrity?

Any guidance would be appreciated!

A broken image logo shows saying that something has tried to be uploaded otherwise the space remains blank, this is the message in SharePoint when I try to open the image in SharePoint.

Below are a couple of examples the first showing all corrupted/failed images the second showing the first 5 photos patching fine and then corrupting/failing the last ones.

 

  • WarrenBelz Profile Picture
    WarrenBelz 145,691 on at
    Intermittent Issue with Patching Images to SharePoint in PowerApps - Corrupted Images
    Hi 1o0o1o1 
    To save you some time here, Power Apps Media is the in-built uploading of images into the app itself and is not relevant to your requirements. I have used a single Image file type a couple of times successfully, patched a second one in a separate action and have found that adding multiple images in the one Patch is highly inconsistent, but other than that have given up using them for the moment.
    A Child Library is always a good and reliable alternative, but more work and needs Power Automate.
  • CK6218 Profile Picture
    CK6218 35 on at
    Intermittent Issue with Patching Images to SharePoint in PowerApps - Corrupted Images
    Try avoid to use the upload image method in powerapps, and yes it's buggy since the first day, microsoft seem no yet fix for it. Some more use image in share point list u cant control the image from power automate. Another alternative solution is use attachment method, u can rename the attachment using power automate during upload process to make it easier to lookup in powerapps, and then u display out the image by using the specific attachment picture file value. It's not about too many image column in sharepoint list, i facing this issue also while only using 1 image column before this, seem until today it's still same problem on image upload
  • 1o0o1o1 Profile Picture
    1o0o1o1 8 on at
    Intermittent Issue with Patching Images to SharePoint in PowerApps - Corrupted Images
    Yeah, I really want to avoid base64 it was all set up that way in the past but the txt data for the images was pretty crazy and if possible, hopefully get it uploading the 8 columns instead of breaking it down or as attachments. Just that everything is set up for it this way already and I am looking to avoid to much work but if it is needed it will have to be.
     
    @SaiRT14 I am not very familiar with the PowerApps.Media function, I have included my on select button for my form submit how would I incorporate the PowerApps.Media function?
     
    // First, check if the item to be patched is not blank
    If(
        Not(IsBlank(CurrentDSDRecord)),
        // Proceed with Patch if an item was found
        Patch(
            Daily_Site_Diary,
            CurrentDSDRecord,
            {
                Project: DSD_Text_Project.Text,
                'Project Number': DSD_text_Project_Number.Text,
                'Protranz PM Email': 'DSD_Text_Project_Manager(Email)'.Text,
                'Protranz Coordinator Email': 'DSD_Text_Project_Coordinator(Email)'.Text,
                Client: DSD_Text_Client.Text,
                Weather: DSD_Text_Weather.Text,
                Date: DSD_Date_Selector_Date.SelectedDate,
                'Site Supervisor': DSD_Input_Site_Foreman.Text,
                'Work Performed': DSD_Input_Work_Performed.Text,
                'Variations / Site Instructions': DSD_Input_Variations.Text,
                Delays: DSD_Input_Delays.Text,
                Considerations: DSD_Input_Considerations.Text,
                Materials: DSD_Input_Materials.Text,
                'Supervisor Comments': DSD_Input_Supervisor_Comments.Text,
                Status: "Submitted",
                'Completed By': DSD_Input_Completed_by.Text
            }
        )
    );
    // First, check if the item to be patched is not blank
    If(
        Not(IsBlank(CurrentDSDRecord)),
        With(
            {
                photoRecord: LookUp(
                    Form_Images,
                    Title = CurrentDSDRecord.Title
                )
            },
            If(
                Not(IsBlank(photoRecord)),
                Patch(
                    Form_Images,
                    photoRecord,
                    {
                        Photo1: If(
                            IsBlank(photoRecord.Photo1),
                            DSD_Taken_Image_Photo1.Image,
                            photoRecord.Photo1
                        ),
                        Photo2: If(
                            IsBlank(photoRecord.Photo2),
                            DSD_Taken_Image_Photo2.Image,
                            photoRecord.Photo2
                        ),
                        Photo3: If(
                            IsBlank(photoRecord.Photo3),
                            DSD_Taken_Image_Photo3.Image,
                            photoRecord.Photo3
                        ),
                        Photo4: If(
                            IsBlank(photoRecord.Photo4),
                            DSD_Taken_Image_Photo4.Image,
                            photoRecord.Photo4
                        ),
                        Photo5: If(
                            IsBlank(photoRecord.Photo5),
                            DSD_Taken_Image_Photo5.Image,
                            photoRecord.Photo5
                        ),
                        Photo6: If(
                            IsBlank(photoRecord.Photo6),
                            DSD_Taken_Image_Photo6.Image,
                            photoRecord.Photo6
                        ),
                        Photo7: If(
                            IsBlank(photoRecord.Photo7),
                            DSD_Taken_Image_Photo7.Image,
                            photoRecord.Photo7
                        ),
                        Photo8: If(
                            IsBlank(photoRecord.Photo8),
                            DSD_Taken_Image_Photo8.Image,
                            photoRecord.Photo8
                        )
                    }
                )
            )
        )
    );
    //Reset the feilds
    Reset(DSD_Date_Selector_Date);
    Reset(DSD_Input_Site_Foreman);
    Reset(DSD_Input_Work_Performed);
    Reset(DSD_Input_Variations);
    Reset(DSD_Input_Delays);
    Reset(DSD_Input_Considerations);
    Reset(DSD_Input_Materials);
    Reset(DSD_Input_Supervisor_Comments);
    Reset(DSD_Input_Completed_by);
    Reset(DSD_PenInput_Signature);
    Reset(DSD_AddMediaButton_1);
    Reset(DSD_AddMediaButton_2);
    Reset(DSD_AddMediaButton_3);
    Reset(DSD_AddMediaButton_4);
    Reset(DSD_AddMediaButton_5);
    Reset(DSD_AddMediaButton_6);
    Reset(DSD_AddMediaButton_7);
    Reset(DSD_AddMediaButton_8);
     
    //Navigate
    Navigate(Daily_Site_Diaries_Screen)
  • WarrenBelz Profile Picture
    WarrenBelz 145,691 on at
    Intermittent Issue with Patching Images to SharePoint in PowerApps - Corrupted Images
    Probably not the answer you want, but using multiple image columns in the same SharePoint list still has some bugs in it (and eight would certainly accentuate this). The most reliable way is to either use Attachments instead or (what I do) a SharePoint Library with a numeric field containing the ID of the "parent" record - however you are going to need Power Automate for that one. This blog of mine may be of some assistance.
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee

     
     
     
  • SaiRT14 Profile Picture
    SaiRT14 1,931 on at
    Intermittent Issue with Patching Images to SharePoint in PowerApps - Corrupted Images
    do the following best practices:
     
    Consider compressing the images on the client side before uploading. You can use the PowerApps.Media function to adjust resolution or size if needed.
    ForAll(
        GalleryImages.AllItems,
        Patch(
            YourSharePointLibrary,
            Defaults(YourSharePointLibrary),
            {
                Title: "Image Title",
                ImageColumn: ImageControlName.Image
            }
        )
    )
     

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,691

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 65,019

Leaderboard