web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Show image based on value
Power Apps
Answered

Show image based on value

(0) ShareShare
ReportReport
Posted on by 16

I need some help....

 

How can I set up a image to be invisible to be visible based on the value of a cell of a form.

 

Im trying to use if(Approved = "Yes",true,false) but it keeps giving me an error message. the word "Yes" turns red

 

Thanks

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,073 Most Valuable Professional on at

    Hi @Wimedina ,

    Just try Approved in the Visible property of the item you want to hide/display.

    I will explain - Boolean fields (yes/no) are actually true/false - the correct syntax of your code would be

    If(
     Approved = true,
     true,
     false
    )

    but you do not have to do all of that. Approved is a Boolean, so is Visible, so Visible can take the value of whatever Approved is.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up

  • eka24 Profile Picture
    20,923 on at
    Hi @Wimedina
    Assuming the Datacardvalue5 (Call it cell), contains the "Approved", Put this formula on the visible of the Image:
    Datacardvalue5.Text="Approved"

    You can also put this formula which will also work:
    If(Datacardvalue5.Text="Approved",true,false)

    Finally you can change the position of true and false to suit your requirements. However the structure of the formula is ok.


    If you like this post, give a thumbs up. Where it solved your issue, Mark as a solution


  • Wimedina Profile Picture
    16 on at

    Im using the syntax 

     

    If(OSHA_DataCard2 = true, true,false) but i am still getting and error.

    Its a yes and no cell on the data source. So I am assuming it either true or false.

  • eka24 Profile Picture
    20,923 on at
    Please it should be on the datacardvalue or textbox not the datacard itself. This OSHA_DataCard2 should be datacardvalue where Approved is typed.
    If(OSHA_DataCard2 = "Aproved",true,false)
    Copy and paste the formula.

    If it doesn't work, give a screenshot.
  • Wimedina Profile Picture
    16 on at
     

    Capture.PNG

    I even changed the "approved" value to yes and true because it is a yes a no toggle on the form

     

  • eka24 Profile Picture
    20,923 on at
    This is OK. Now take a screenshot of OSHA_DataCard2 where it contains "Approved"
  • eka24 Profile Picture
    20,923 on at

    My screenshot

    approved.JPG

  • Wimedina Profile Picture
    16 on at
     

    Capture.PNG

  • eka24 Profile Picture
    20,923 on at
    Yes this image will help. What you have clicked is datacard. Now on the same OSAH DATACARD, click on the small arrow in the left of OSAH DATACARD, to expand it. Then you will see a name ending datacardvalue. Use that name to replace it in the formula.

    You can look at my last reply. I sent a screenshot
  • eka24 Profile Picture
    20,923 on at
    Since from the picture is can be seen as a Toggle control, the formula is slightly different.
    Put this on the visible of the Image:
    ToggleName.Value=true

    So as the toggle control is changed, the Image will be visible or invisible

    Replace ToggleName with the actual name after you have clicked under the datacard.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard