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 / Image - How to confirm...
Power Apps
Unanswered

Image - How to confirm patch has saved the data?

(1) ShareShare
ReportReport
Posted on by 91
Hi,
 
After a patch function has run and saved the data into a SharePoint list, how can I confirm that the image is saved (by not only relying on IfErrorr)?
 
I’ve tried comparing the image I’m saving with the SharePoint image (after save) by:
- uploading both (before and after) into a collection and comparing the collection data with the .Full attribute
- comparing without the .Full attribute
- comparing both collection images through the Image property of an Image box
 
All three attempts are providing a result stating the images are different when the save has worked.
Categories:
I have the same question (0)
  • Suggested answer
    Nandit Profile Picture
    1,568 Moderator on at
    Hi Samand,
     
    You are saying images are different when the save has worked, isn't that the desired output if you are trying to replace the existing (before image)? 
    I think the best way to show that the Image has gone through would be to display the uploaded image back to the user. 
     
    You can try two scenarios:
    1. Replace the existing image in SP 
    2. Upload a new picture / record and display it back to the User
     
    Scenario 1:
    I am using an "Add Picture" control to patch and replace an existing image
    My Patch code:
    Patch(
        SPList,
        LookUp(
            SPList,
            ID = 2
        ),
        {image: UploadedImage1.Image}
    )
    Before Patch:
    After Patch:
     
    Scenario 2:
    I upload a new picture to the SP list and try to retrieve it as the last item saved to the list.
    My Patch Code:
    Patch(
        SPList,
        Defaults(SPList),
        {
            Title: "Test",
            image: UploadedImage1.Image
        }
    );
    
    
    Last Picture Saved code:
    If(
        IsBlank(
            First(
                SortByColumns(
                    SPList,
                    "Created",
                    SortOrder.Descending
                )
            ).image
        ),
        SampleImage,
        First(
            SortByColumns(
                SPList,
                "Created",
                SortOrder.Descending
            )
        ).image
    )
    Before Patch:
    After Patch:
     
    Hope this helps. 
     
    Kind regards,
    Nandit
     
    If this answers your query, please mark this response as the answer.
    If its helpful, please leave a like. Thanks!
     
  • Samand Profile Picture
    91 on at
    Hi Nandit,
     
    It’s not different Images I’m trying to compare. I’m trying to confirm that the image that the user is saving has saved to SharePoint. By image “before” I meant the same image which is in a collection before the save. And then comparing it to another image uploaded into a collection after the save, but the source this time is the SharePoint list.
  • WarrenBelz Profile Picture
    153,034 Most Valuable Professional on at
    Coming in here in case the requirement is the rather unusual need to compare two images - this will return true or false if you have both images in Image controls
    JSON(
        Image1.Image,
        JSONFormat.IgnoreBinaryData
    ) = JSON(
        Image2.Image,
        JSONFormat.IgnoreBinaryData
    )
     
  • Verified answer
    SaiRT14 Profile Picture
    1,990 Super User 2025 Season 2 on at
    Pls check the following steps:
     
    • When you Patch the image to SharePoint, ensure that the Image URL or metadata is stored correctly in a SharePoint column.
    • For images saved to SharePoint, you can capture the file name or URL (if using a document library) and use it for comparison.
    • After running the Patch function, retrieve the saved image's URL from SharePoint.
      • Set(savedImageUrl, LookUp(SharePointList, ID = Last(SharePointList).ID).ImageColumn)
         
    • compare the image URLs or file names
      • If(
           imageToSave.Url = savedImageUrl,
           Notify("Image saved successfully.", NotificationType.Success),
           Notify("Image not saved.", NotificationType.Error)
        )
         
    • collect the newly saved record from SharePoint into a collection and compare the URL or metadata of the images.
      • ClearCollect(savedImageCollection, LookUp(SharePointList, ID = Last(SharePointList).ID));
        If(
           savedImageCollection.ImageColumn = imageToSave.Url,
           Notify("Image matches successfully.", NotificationType.Success),
           Notify("Image mismatch.", NotificationType.Error)
        )
    Let me know if you need more details.

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 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard