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 / If/Then Statement usin...
Power Apps
Unanswered

If/Then Statement using Dataverse Yes/No Choice Column shows formula not in scope.

(0) ShareShare
ReportReport
Posted on by 81

With a form data card I am trying to write a simple if/then statement to change the color of the card based on the value of a (Yes/No) Choice field (In_Spec) in the record.

 

Within the fill property:

If(ThisItem.In_Spec,

RGBA(0,255,0,.5),

RGBA(255,0,0,.5))

 

The error I get is: 

ce_PowerPlay_0-1697552528649.png

Can someone explain the correct way to use a Dataverse table (yes/no) choice column in a record so it can be used to evaluate an If/Then statement in a power apps canvas app.

 

 

 

Categories:
I have the same question (0)
  • Verified answer
    Anchov Profile Picture
    1,986 on at

    To evaluate a Yes/No column in Dataverse, you need to specify the Yes and No values by selecting the appropriate options from the "Choice Set." This is typically in the format of '[Name of Yes/No Column] ([Name of Table])].[Selected Choice]'. Here's an example:

    Anchov_0-1697558697203.png

     

     

    If(ThisItem.Active = 'Active (Dog Breeds and Characteristics)'.Yes, "Active", Blank())

     

    For you it will be something like:

     

    If(ThisItem.In_Spec = 'In_Spec (yourtablename)'.Yes,
    RGBA(0,255,0,.5),
    RGBA(255,0,0,.5))

     

    Hint: The intellisense in the formula bar should help you fill in and validate the choice set by starting to type your column name.

    Anchov_1-1697559162662.png

     


    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.

    Cheers!
    Rick Hurt

  • CE-16101943-0 Profile Picture
    81 on at

    You are correct that works.  When working with Forms & Datacards inside Power Apps there is one more step that I found is necessary.  The data card for the choice column must be included in the form.  You can make it invisible, but it has to be there.  This may be a bug, but the logic @Anchov explained will only work if the evaluated choice column's datacard is included in the form.

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 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard