Skip to main content
Community site session details

Community site session details

Session Id : nHWc7ioQgtr56IiKx0W216
Power Apps - Building Power Apps
Answered

IF Choice Field = 1 Then

Like (0) ShareShare
ReportReport
Posted on 14 Feb 2024 15:05:05 by 219

Hi,

 

I have a dataverse table with a column called "Environment" which is a Choice field with the following values:

Name - Value
Convenience = 1
Cafe = 2

 

What I'm trying to do is if the Environment value of a record equals 1 (convenience) then to hide a form. This is the code I'm using but it doesnt seem to work and no error is provided.

 

If(varRecordID.Environment = 1, range_conv.Visible = false);

 

varRecordID is the current record. What am i doing wrong here?

 

Any help would be much appreciated, thank you.

  • CCEP_Mike Profile Picture
    219 on 14 Feb 2024 at 15:49:43
    Re: IF Choice Field = 1 Then

    @SpongYe thank you very much for your help 🙂

  • Verified answer
    SpongYe Profile Picture
    5,580 Super User 2025 Season 2 on 14 Feb 2024 at 15:43:48
    Re: IF Choice Field = 1 Then

    Hi @CCEP_Mike 

     

    You can set the .Visible of range_cov like that. There are multiple ways to solve this issue:

    One way is to use UpdateContext() instead:

    If(
     varRecordID.Environment = 1, 
     UpdateContext({varRange_conv: false}),
     false
    );

    And then in the Visible property of range_conv add the new variable varRange_conv.

     

    Another way is that you directly add the formula in the Visible property of range_conv:

    varRecordID.Environment <> 1

     This will generate a boolean and make you control visible or not.

     

    If you have any questions or feedback, please let me know. Have a great day! 😊

    -----------------------
    PowerYsa Power Platform Enthusiast [LinkedIn] | [Youtube]

    I love to share my knowledge and learn from others. If you find my posts helpful, please give them a thumbs up 👍 or mark them as a solution ✔️. You can also check out my [@PowerYSA] for some cool solutions and insights. Feel free to connect with me on any of the platforms above. Cheers! 🍻

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

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 637 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 570 Super User 2025 Season 2

#3
Power Apps 1919 Profile Picture

Power Apps 1919 473

Loading complete