0

I have a PowerApp that displays a field from an entity which is two options, Yes or No. I want to add an icon to the PowerApp screen that will be an 'X' if the value is No or a checkmark if the value is Yes.

How do I use an if statement on the icon to check the datacardvalue to see if it is yes or no? Is that possible?

Breaker
  • 23
  • 1
  • 4

2 Answers2

0

Assuming:

  • The "field from an entity which is two options" is a Dropdown control named ddEntity_1:

  • The Icon control is named icn_1

Set the...:

  • icn_1.Icon property to
If(
    ddEntity_1.Selected.Value = "Yes", Icon.Check,
    ddEntity_1.Selected.Value = "No", Icon.Cancel
)

If the Entity field in question is a Textbox instead of a Dropdown, substitute .Text for .Selected.Value above.

SeaDude
  • 3,725
  • 6
  • 31
  • 68
0

You can initially add two icons into PowerApp screen ,one for 'X' for No and other checkmark for Yes,say Icon_NO and Icon_Yes respectively. In the Icon_NO.Visible you can set as below,ie if selected value is NO,Icon_No shows up

    If(dropdown.SelectedText.Value ="No",true,false)

and in Icon_Yes.Visible you can set as below,ie if selected value is Yes,Icon_Yes will show

    If(dropdown.SelectedText.Value="Yes",true,false)