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 / Conditionally show ima...
Power Apps
Unanswered

Conditionally show image based on multiple values

(0) ShareShare
ReportReport
Posted on by 1,599 Super User 2024 Season 1

Hello,

 

On my PowerApp I have multiple yes/no switches. Each of these has an image/icon to display what it relates to. What I want to do is that if the form is in Edit mode, then all the images should be displayed.
If the fom is in read-only mode then the images should only be displayes if the yes/no switch equals "true" and if "false" no not display the image.

sudosaurus_0-1642765461185.png

 

Categories:
I have the same question (0)
  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    You have 2 options.

    1:
    Add 2 images (1 for toxic and other for the other) and OnVisible write:

    If(Toggle1.Value = true, true, false) or the condition you want

     

     

     

    2:

    Add only a single image and write tis on Image

     

    If(Toggle1.Value = true, Toxic.png, OtherImage.png)

     

    If you need additional help please tag me in your reply and please like my reply.
    If my reply provided you with a solution, pleased mark it as a solution ✔️!

    Best regards,
    Gonçalo Nogueira

    Check my LinkedIn!

    Check my User Group (pt-PT)!

    Last Post on Community

    My website!

  • sudosaurus Profile Picture
    1,599 Super User 2024 Season 1 on at

    Hi @Nogueira1306 

    On the visible property? - doesnt look right to me. The source image is named "Toxic.gif" if that helps.

    sudosaurus_0-1642767314532.png

     

    sudosaurus_1-1642767362825.png

     

     

  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    In the visible property you dont set the iamge, you say if it is visible or not (true or false)

    If(DataCardValue8.Value = true, true, false)

    If it is toxic, it will show the image, if not, no.

     

    If you need additional help please tag me in your reply and please like my reply.
    If my reply provided you with a solution, pleased mark it as a solution ✔️!

    Best regards,
    Gonçalo Nogueira

    Check my LinkedIn!

    Check my User Group (pt-PT)!

    Last Post on Community

    My website!

  • sudosaurus Profile Picture
    1,599 Super User 2024 Season 1 on at

    Hi @Nogueira1306 

     

    Just to clarify, which value am I doing that on?

  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    Nogueira1306_0-1642776346874.pngNogueira1306_1-1642776373322.png

     

  • sudosaurus Profile Picture
    1,599 Super User 2024 Season 1 on at

    Hi @Nogueira1306 

     

    So, I've uploaded a blank png file to my App and then I've used this expression:
    It still doesn't seem to like it - have done as you've said above.

    sudosaurus_0-1642777298296.png


    What do you think is up?

  • avootla1 Profile Picture
    31 on at

    @sudosaurus  

    You can try this
    If(DataCardValue8.Value, blank, Toxic)

    If blank is an image by itself, say blank or simply say None which means you are not showing any image

  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    You need to insert the name of the images.

    Toxic is a image?

    Balnk is a image?

  • sudosaurus Profile Picture
    1,599 Super User 2024 Season 1 on at

    @avootla1 that's great.

     

    How would I go about hiding data cards if the value is set to "No"?

     

    For example, one of my data cards is named: Toxic_DataCard1
    and the yes/no value is named: DataCardValue8

     

    Thanks!

  • avootla1 Profile Picture
    31 on at

    @sudosaurus 
    Set the Toxic_DataCard1.Visible property to something like this
    If(DataCardValue8.Value = "yes", true, false)

     

    This works if yes/no are string values. If they are option values then you may have to call the optionset and assign the value. 

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 April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 610

#2
Haque Profile Picture

Haque 317

#3
WarrenBelz Profile Picture

WarrenBelz 315 Most Valuable Professional

Last 30 days Overall leaderboard