Power Apps Dataverse Yes/No Field

This Power Apps Dataverse tutorial will cover all you need to know about the Dataverse Yes/No Column, including what a Dataverse Yes/No field is and how to create one.

In a recent project, I had to use the Dataverse Yes No field in a Power Apps Form and apply it appropriately.

This Microsoft Dataverse guide will let you understand how to build a Power Apps Dataverse Yes No field, how to use it, and many more like below:

  • How to display choices in a Power Apps Dropdown
  • How to Filter Yes/No column Dataverse in Power Apps
  • Filtering by a Specific Yes/No Value in Dataverse
  • How to patch Dataverse Yes/No Column

What is Dataverse Yes/No column?

Power Apps Dataverse Yes No column resembles a Dataverse Choice column in that it only accepts two values. By default, those two pairs are referred to as Yes and No. The labels can be altered, though.

Create Dataverse Yes/No Column

Next, we will see how to create a Yes/No column in the Dataverse table. Follow the instructions below:

Go to your Dataverse Custom data table (Job Seekers Registration List), and click on the + New column. On the New column pane, specify the below fields:

  • Display name = This is a required column. Enter the name of the Yes No column (suppose Is Document Submitted) you want to create in the Dataverse table.
  • Description = Give a detailed description of the field that will be created. This column is optional.
  • Data type = When the chevron is expanded, two sorts of options—Choice and Yes/no—are shown. If you want to add a Yes/no field, use the Yes/no data type.
Power Apps Dataverse Yes No Field
Power Apps Dataverse Yes No Field
  • Behavior = Select the field behavior either Simple, Calculated, or Rollup.
  • Required = You can choose it either for your Business recommendedBusiness Required, or Optional.
  • Searchable = A checkbox next to this option indicates that you want this field to be searchable. It is turned on by default.
  • Choices = There are two types of choices available i.e.
    • Label = This label will let you change the label’s name, for example, from No to Off or something else.
    • Value = The label value field will also have a starting value of 0, 1, 2, and so forth.
    • Also, you can provide the color for the choices.
  • Default choice = This field must be filled out with a default selection of either Yes or No. It will always remain No only by default.
  • Schema name = Whenever, you will expand the Advanced options, you can view this field called Schema name. It is a column that has already been filled in with data from the display name. It contains the customization prefix for the Dataverse solution publisher. You won’t be able to edit the table once you’ve saved it.
Dataverse Yes No Field
Dataverse Yes No Field
  • Now Save the column as shown below. After a second of time, the Yes no field is ready to use in the Dataverse table. The yes-no field is visible in the screenshot below, along with each row’s values.
PowerApps Dataverse Yes No Field
PowerApps Dataverse Yes No Field

This is how we can create a Yes/No Column in the Dataverse table.

See also  Power Apps Filter Gallery by Dropdown [With Examples]

Also, read: Delete All Records From Dataverse Table [With Examples]

Display Choices in a Power Apps Dropdown

After that, we’ll talk about how to make Dataverse choices or Yes/No values appear in a Power Apps Dropdown control.

  • We must first connect the Dataverse table connector to the app before we can add the choices to the Power Apps Dropdown. in order for us to have access to every column in that particular dataverse table.
  • To add the Dataverse table, go to the Data tab (from the left navigation) -> Expand + Add data -> Search the Dataverse table name (Job Seekers Registration Lists) and select it or Select the Dataverse table under the Tables section. Now the specific Dataverse table has been added to the app.
Display choices in a Power Apps dropdown
Display choices in a Power Apps dropdown
  • Now, add a Power Apps Dropdown control and apply the code on its Items property:
Items = Choices('Is Document Submitted (Job Seekers Registration Lists)')

Where,

  1. Is Document Submitted = Name of the Yes/No field
  2. Job Seekers Registration Lists = Dataverse table name

NOTE:

You can use the Power Apps Combo box control in addition to the Power Apps Dropdown control.

Refer to the image below.

Display Dataverse Yes No field in a Power Apps dropdown
Display Dataverse Yes No field in a Power Apps dropdown
  • Save, Publish, and Preview the app. When we click on Chevron, the Yes/No choice values are displayed as in the sample below.
Display Dataverse choices in a Power Apps dropdown
Display Dataverse choices in a Power Apps dropdown

This is how to display choices in a Power Apps Dropdown Control.

Check out: How To Get Row by ID From Dataverse Table

Power Apps Filter Yes/No column Dataverse

Here we will understand how to filter Dataverse Yes/No column in Power Apps.

  • Assume a straightforward example. You can see a Power Apps Combo box control and a Data table in the screenshot below.
  • The Yes/No options in that combo box are taken from the Dataverse Choice column. Now, what I would like to do is have the data table filter and show all the records based on the yes/no values picked from the combo box when we choose any yes/no value from the combo box.
  • For example, the data table filters and shows all the items whose value is Yes if I select Yes in the combo box.
Power Apps Filter Yes No column Dataverse
Power Apps Filter Yes No column Dataverse
  • To achieve this, select the Combo box control and set its Items property as:
Items = Choices('Is Document Submitted (Job Seekers Registration Lists)')
  1. Is Document Submitted = Dataverse Yes No Choice column name
  2. Job Seekers Registration Lists = Dataverse Table name
PowerApps Filter Yes No column Dataverse
PowerApps Filter Yes No column Dataverse
  • Then, add a Power Apps Data table and apply the code below on its Items property as:
Items = Filter(
    'Job Seekers Registration Lists',
    'Is Document Submitted' = cmbIsDocSubmitted.Selected.Value
)

Where,

See also  Power Apps List Box Control - How to Use?

cmbIsDocSubmitted = This is the Combo box control name

Refer to the figure below.

Filter Dataverse Yes No column in Power Apps
Filter Dataverse Yes No column in Power Apps
  • Save the app and then run a preview. The data table will filter based on any choice value (Yes/No) that you choose from the combo box.

This is how to work with Power Apps Filter Yes/No column Dataverse.

Have a look: How To Get Dataverse List Rows Count Using Power Automate

Filtering by a Specific Yes/No Value in Dataverse

Are you wondering how to filter the Power Apps Gallery control by a specific Dataverse Choice (Yes/No) value? Be at ease. Look at the example below.

There is a Gallery control in Power Apps. The next step is to filter out all records with a No value and only show those specific records.

To work around this, select the gallery control and set its Items property to the code below:

Items = Filter(
    'Job Seekers Registration Lists',
    'Is Document Submitted' = 'Is Document Submitted (Job Seekers Registration Lists)'.No
)

Where,

No = Specify the specific choice value from the Dataverse Yes No field

Filter specific Choice value in Dataverse
Filter specific Choice value in Dataverse

This way, we can filter by a Specific Yes/No Value in Dataverse.

Read: How to get data from Dataverse in Power Apps

Patch Dataverse Yes/No Column

Next, we will see how to patch the Dataverse Yes No column in Power Apps.

  • A Job Seekers Registration Form with multiple Power Apps input controls and a button control is seen in the screenshot below.
  • As you can see there is a Dropdown control (Is Document Submitted) that contains Dataverse Yes no field value. I now want to use Power Apps to patch the Dataverse yes/no value in the Dataverse table.
  • The user must fill out every field on the form, including the Dataverse Yes/No field before clicking the Register button. A new item will be created in the specific dataverse table (Job seekers Registration List) once the user clicks the Register button as shown below.
See also  Power Apps First, FirstN, Last, and LastN Functions [With Examples]

Refer to the things below to approach this.

Patch Dataverse Yes No Column
Patch Dataverse Yes No Column
  • First, select the Dropdown control (Is Document Submitted) and set its Items property as:
Items = Choices('Is Document Submitted (Job Seekers Registration Lists)')
Patch Dataverse yes no field
Patch Dataverse yes no field
  • Select the REGISTER button and apply the code below on its OnSelect property as:
OnSelect = Patch(
    'Job Seekers Registration Lists',
    Defaults('Job Seekers Registration Lists'),
    {'First Name': txtFirstName.Text},
    {SurName: txtSurName.Text},
    {RegistrationID: txtRegID.Text},
    {AddressForCorrespondence: txtAddress.Text},
    {'Is Document Submitted': ddSelectOption.Selected.Value}
)
  1. txtFirstName = Text input control name for the first name.
  2. txtSurName = Text input control name for the Surname.
  3. txtRegID = Text input control name for the Registration ID.
  4. txtAddress = Text input control name for the Address.
  5. ddSelectOption = Dropdown control name

Refer to the screenshot below.

How to patch Dataverse yes no column in Power Apps
How to patch Dataverse yes no column in Power Apps
  • Now save, publish, and preview the app. Provide all the information to the form and tap on the REGISTER button.
  • Then, go back to the Dataverse table and refresh it. You can see the new item has been created in the Dataverse table as image below.
How to patch Dataverse yes no column
How to patch Dataverse yes no column

This is how to patch the dataverse Yes/No column in Power Apps.

Also, you may like some more Power Apps Dataverse Tutorials:

This Dataverse tutorial explained what Dataverse Yes No field is, how to create a Yes No column in the Dataverse table, and its uses. Also, we covered these many topics below:

  • Display choices in a Power Apps Dropdown
  • Filter Yes/No column Dataverse in Power Apps
  • Filtering by a Specific Yes/No Value in Dataverse
  • Patch Dataverse Yes/No Column
>