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
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,483)