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 / conditional Image disp...
Power Apps
Answered

conditional Image display in the gallery image field from saved in the media Images

(0) ShareShare
ReportReport
Posted on by 2

developing a  powerapp applicaiton for our teams.

uploaded some images in media category, some are .jpg and some .png.

 

I want to display these images conditionally in the gallery image field. 

If the category in the gallery is BULLDOZER, then it should Bulldozer.jpg

If the category in the gallery is EXCAVATOR, then it should Excavator.jpg

 

Image of the canvas is as below :

 

MIA27_0-1706954356504.png

 

MIA27_1-1706954417462.png

 

 

pls. advise, how to connect Image to the media file conditionally

Categories:
  • Verified answer
    WarrenBelz Profile Picture
    156,566 Most Valuable Professional on at

    Hi @MIA27 ,

    You did not post where you were displaying the image, but if in a Gallery or Form - the Image property

    Switch(
     ThisItem.Category,
     "BULLDOZER",
     Bulldozer,
     "EXCAVATOR",
     Excavator,
     . . . . .
    )

     

    Please click Accept as solution 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 Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

     

  • MIA27 Profile Picture
    2 on at

    Thank you.

    The image to be displayed is in the gallery, applied your advised code and it worked. below is the image.

     

    As a new in this development, unable to understand the below 2 points :

    a) how it got connected to images based on the criteria, I was expecting to provide code wise location to reach till the image stored location in the app.

    b) how it recognize without .jpg or .png and it accepts.

    c) the images can be multi used on any screen within this app

    MIA27_1-1706966026032.png

     

     

     

  • Verified answer
    WarrenBelz Profile Picture
    156,566 Most Valuable Professional on at

    Hi @MIA27 ,

    Answers below: -

    a) how it got connected to images based on the criteria, I was expecting to provide code wise location to reach till the image stored location in the app.
    Images stored in the internal Media storage can be referenced directly in an Image Control as simply their name.

    b) how it recognize without .jpg or .png and it accepts.
    The facility will not accept two images with the same name and different file types

    c) the images can be multi used on any screen within this app

    Correct

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 383 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 356

#3
WarrenBelz Profile Picture

WarrenBelz 232 Most Valuable Professional

Last 30 days Overall leaderboard