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
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

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