Skip to main content
Community site session details

Community site session details

Session Id : 137FPL42O7djZglnGvUQDf
Power Apps - Building Power Apps
Answered

Image Control - Check Gallery

Like (0) ShareShare
ReportReport
Posted on 3 Jun 2024 10:12:28 by 81

Hello,

 

I am building an Asset Management tool.

 

I have an Upload Image control thats working and patching and displaying correctly (ViewAssets.Selected.Image - working).

 

I want to be able to change the image, I was trying: (Checking the gallery, but allowing me to swap image out if needed)

 

If(
!IsBlank(ViewAssets.Selected.Image),
ViewAssets.Selected.Image,
If(
IsBlank(AddMediaButton1_1.Media),
SampleImage,
AddMediaButton1_1.Media
)
)
 
Logically this seems sound but Im getting an error, EXPECTED IMAGE VALUE.
Categories:
  • Verified answer
    CraigRooney Profile Picture
    81 on 04 Jun 2024 at 08:28:39
    Re: Image Control - Check Gallery
    If(IsBlank(AddMediaButton1_1.Media), ViewAssets.Selected.Image.Full, AddMediaButton1_1.Media)
     
    This ended up being the working formula. I needed to add Image.FULL to get it working. 
  • timl Profile Picture
    35,242 Super User 2025 Season 2 on 03 Jun 2024 at 10:46:07
    Re: Image Control - Check Gallery

    Hi @CraigRooney 

    The upload image control is a composite control and it's the image control that you need to reference (eg UploadedImage1) rather than the Media property of the button.

     

    timl_0-1717411288684.png

    Also, the Coalesce function should logically perform the same function as your 2 nested If statements.

    Coalesce(ViewAssets.Selected.Image,
     UploadedImage1_1.Image,
     SampleImage
    )

     

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

Announcing our 2025 Season 2 Super Users!

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!