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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Getting the value of a...
Power Apps
Answered

Getting the value of a yes/no dataverse column in Canvas Apps

(0) ShareShare
ReportReport
Posted on by 581
I'm using dataverse as a datasource.
 
I need to get the value of a yes/no column as a variable (or at least part of a collection)
 
I am repeatedly getting an error whenever I try and output this. Any attempts I have to handle this error, leads to an error on that attempt.
 
I'm aware there may be an issue with a Canvas App not being able to read the default. However it's becoming impossible for me to handle and set an error to false
 
Has anybody seen this before?
 
Thanks
Categories:
I have the same question (0)
  • MichaelFP Profile Picture
    1,943 Moderator on at
    You can get the value just select the field.

    Below an example that i get the the Field "Do not Allow Fax" in account table. It is two options: Allow / Do not Allow. 

     
    if you want to compare you can use the options metadata to check if the record has the value that you expected

     
    If my answer helped you, please give me a thumbs up (👍). If solve your question please mark as answer ✔️. This is help the community.
  • Lee-Martin Profile Picture
    581 on at
    @MichaelFP - thank you but I need to use it as comparison not as output. 
     
    Whenever I do this, variable=true 
    I get (These types cannot be compared: Error, Boolean)
  • Lee-Martin Profile Picture
    581 on at
    Below is my code.
     
    I cannot find anyway at all for this the varDiField to not come out as an error.
     
    MyDelegate has eaxctly one row when I put it into the collection (Which is expected)
     
    Where am I going wrong?
     
    Thanks in advance
     
    Set(varDiField, false);
    ClearCollect(
        MyDelegate,
        ShowColumns(
            Filter(
                'Delegate DataSource',
                'relationshipField'.'ParentTable' = GUID(myID) &&
                Email = varUserEmail
            ),
            'DI Field',
            'Days',
            'Nights'
        )
    );
    // Check if MyDelegate is empty
    If(
        !IsEmpty(MyDelegate),

         Set (varDiField, If(First(MyDelegate).lee_difield, "Yes", "No"));
    );
     
  • Verified answer
    MichaelFP Profile Picture
    1,943 Moderator on at
    to compare it is easy as i showed
     
    in your if that validate you need to select the field and select the choice metadata with the value.
     
    you will gonna see the metadata info with the name of the field and between parenthesis with the name of the table
     
     
    //here I'm comparing if the Field in the account "Do not Allow Faxes" has the choice Allow from "Dot not Allow Faxes (Account)" 
    First(Accounts).'Do not allow Faxes' = 'Do not allow Faxes (Accounts)'.Allow
     
    here an example set the value from choice in a variable
     
    Set(varChoice,
        If(First(Accounts).'Do not allow Faxes' = 'Do not allow Faxes (Accounts)'.Allow,
            'Do not allow Faxes (Accounts)'.Allow,
            'Do not allow Faxes (Accounts)'.'Do Not Allow'
        )
    );
     
     
  • Lee-Martin Profile Picture
    581 on at
    It turns out I had a number of things going wrong at the same time, complicated by things seeming to work but not.
     
    Eventually I managed to complete this "wack a mole" and got it working
  • Suggested answer
    PakWarrior Profile Picture
    17 on at
    For Classic Toggle - 
     
    Toggle: Default: ThisItem.Test2 = 'Test2 (TestTables)'.Yes
     
    For Modern Toggle - 
     

    Toggle: Checked: ThisItem.Test2 = 'Test2 (TestTables)'.Yes

     

    Datacard: Update: If(DataCardValue2.Checked, 'Test2 (TestTables)'.Yes, 'Test2 (TestTables)'.No)

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 536

#2
WarrenBelz Profile Picture

WarrenBelz 426 Most Valuable Professional

#3
Haque Profile Picture

Haque 305

Last 30 days Overall leaderboard