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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Power Apps – Replace/U...
Power Apps
Answered

Power Apps – Replace/Update photo in SharePoint list from Gallery item (with placeholder image)

(0) ShareShare
ReportReport
Posted on by 41

Hi everyone,

I’m working on a Power App with a SharePoint list as the data source. The list contains location records, each with an Image column (LocationPhoto).

 

In my Gallery (GalleryLocations), I want to:

 
  • Show a placeholder image when there’s no photo yet.

  • If a photo already exists, display it in the gallery.

  • Allow the user to upload or take a new photo and have it replace the existing photo for that gallery item.

 

What I tried:

Patch(
Locations,
GalleryLocations.Selected,
{ LocationPhoto: AddMediaWithImage.Media }
)
 

But this gives errors like “LocationPhoto does not meet record type” or Power Apps expects a resettable control as input.

I also tried using variables, JSON(), and Reset(AddMediaWithImage), but still can’t get it to replace the existing image.

 

Question:

What is the correct approach to:

  1. Show a placeholder image in the gallery if no photo exists.

  2. Upload/take a new photo from AddMediaWithImage and replace/update the LocationPhoto in the selected SharePoint record?

 

Any working examples or best practice patterns would be very helpful.

Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    154,799 Most Valuable Professional on at
    Hi @ryb,
    Firstly upload your placeholder image to your Media - I will call it PlaceHolder below and then on your Image control in the Gallery (assuming you have a seperate Image control) add to the Image property.
    Coalesce(
       ThisItem.LocationPhoto.Large,
       PlaceHolder
    )
    If you want to do the whole thing on the AddMediaWithImage control, make the Image of the UploadedImage control
    Coalesce(
       AddMediaButton.Media,
       ThisItem.LocationPhoto.Medium,
       PlaceHolder
    )
    You may also need to reduce the font size of the button.
     
    Next your Patch
    Patch(
       Locations,
       LookUp(
          Locations,
          ID = GalleryLocations.Selected.ID
       ),
       {LocationPhoto: UploadedImage.Image}
    )
     
    Please ✅ 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.
    Visit my blog Practical Power Apps    LinkedIn   

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 536

#2
WarrenBelz Profile Picture

WarrenBelz 426 Most Valuable Professional

#3
Haque Profile Picture

Haque 305

Last 30 days Overall leaderboard