cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sudosaurus
Post Prodigy
Post Prodigy

Conditionally show image based on multiple values

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

 

15 REPLIES 15
Nogueira1306
Super User
Super User

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
Post Prodigy
Post Prodigy

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

 

 

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
Post Prodigy
Post Prodigy

Hi @Nogueira1306 

 

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

Nogueira1306_0-1642776346874.pngNogueira1306_1-1642776373322.png

 

sudosaurus
Post Prodigy
Post Prodigy

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
Frequent Visitor

@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

You need to insert the name of the images.

Toxic is a image?

Balnk is a image?

sudosaurus
Post Prodigy
Post Prodigy

@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!

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,499)