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

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

sudosaurus
Post Prodigy
Post Prodigy

@avootla1 I only want this to occur when the form is in view only mode. In new and edit modes all the datacards need to show.

avootla1
Frequent Visitor

@sudosaurus 

 

then the condition looks something like this

If(DataCardValue8.Value = "yes" And FormName.DisplayMode = DisplayMode.View, true, false)

 

Change FormName to the name of your form and try. Lmk if this works.

 

 

sudosaurus
Post Prodigy
Post Prodigy

@avootla1 I tried that.

 

If(DataCardValue6.Value = "yes" And SelectedItem_form.DisplayMode = DisplayMode.View, true, false)

It doesn't show the datacard when in Edit mode.

avootla1
Frequent Visitor

@sudosaurus 
is DataCardValue6, part of SelectedItem_form?

if it is inside the form. the above condition will not work.

sudosaurus
Post Prodigy
Post Prodigy

@avootla1 

 

What options do I have?

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 (1,873)