Do you how to set a Power Apps checkbox value? Follow this Power Apps tutorial to get all the information about the Power Apps checkbox value.
Here, we will discuss what are the properties of a Power Apps checkbox control. Also, we will see how to add a checkbox control and Power Apps checkbox value manually.
Additionally, we will also cover the below topics. Such as:
- How to set Power Apps Checkbox Value from SharePoint List
- PowerApps if Checkbox is Checked
- Power Apps Checkbox Checked Value
Power Apps Checkbox
The Power Apps Checkbox control allows the user to select or clear to set its value to true or false and this control allows users to select one or multiple options from a list of choices.
When a user selects the Power Apps check box, the value will be true and when it is cleared, then the value will be false.
PowerApps checkbox Properties
Here, we will see what are the key properties of the checkbox control in the Power Apps.
Refer to the below table:
Property | Description |
Text | It specifies the text that appears on the control or you need to type a text into the control |
Value | This Value property specifies the value of the input control |
Default | It is the initial value of control before it is changed by the user |
BorderColor | It helps to display the color of a control’s border |
OnCheck | It specifies how an app responds when the value of a checkbox or a toggle changes to true |
OnSelect | It specifies how the app responds when the user taps or clicks a control |
OnUncheck | It specifies how an app responds when the value of a checkbox or a toggle changes to false |
Reset | It specifies whether the control reverts to its default value |
Size | It helps to set the font size of the text that appears on a control |
Visible | It specifies whether a control appears or hidden |
CheckmarkFill | It defines the color of the checkmark in a checkbox control |
Color | It defines the color of the text in a control |
Fill | It specifies the background color of a control |
Visible | It specifies the text appearing on the control, or you need to type it into the control |
These are the properties of a Power Apps checkbox control.
How to Add Power Apps Checkbox Control
Next, we will see how to add a Power Apps checkbox control to a Power Apps canvas app.
1. Open Power Apps with your respective Microsoft credentials -> Create a Blank canvas app as shown below.
2. On the Power Apps Screen -> Insert a Check box control [Click on the + Insert button -> Expand Input -> Select Check box].
3. By default, the Checkbox’s Text property is “Option” and the name of the Checkbox is CheckBox1 as in the screenshot below.
This is how to add a Power Apps checkbox control in a canvas app.
How to Set Power Apps Checkbox Value
Let’s see how to set the Power Apps checkbox value using two examples. Such as:
- Power Apps Checkbox Value Manually
- How to set Power Apps Checkbox Value from SharePoint List
Power Apps Checkbox Value Manually
In Power Apps, there is a checkbox control, and this control contains the below manual value, i.e., [Check Now].
Refer to the below screenshot:
To do so, select the Checkbox control and set its Text property to the code below.
Text = "Check Now"
This is how to set the Power Apps checkbox value.
Set Power Apps Checkbox Value from SharePoint List
Here, we will see how to set a PowerApps checkbox value from the SharePoint list with a simple scenario:
Scenario:
I have a SharePoint list Online named “Product Details”. This list contains the below fields.
In Power Apps, there is a Checkbox control, a gallery control, and a Text input control. When the user selects any product name from the checkbox control inside the gallery, the Text input control displays the selected product price as in the screenshot below.
To achieve it, follow the below steps. Such as:
1. On the Power Apps screen -> Insert a Blank flexible gallery control and set its Items property as:
Items = 'Product Details'
Where,
- ‘Product Details’ = SharePoint Online List
2. Then, insert a Checkbox control inside the gallery and set its Text property to the code below.
Text = ThisItem.Title
Where,
- Title = SharePoint list text field
3. Whenever we add a Check box control, we can select multiple check box values. However, our requirement is only to select a single check box value instead of multiple selections.
4. To do so, set the Check box’s OnCheck, Default, and DisplayMode properties as shown below.
OnCheck = Set(
varCheck, //OnCheck Property
gal_EmployeeDepartments.Selected.Title
)
Default = varCheck=ThisItem.Title //Default Property
DisplayMode = If(
varCheck = ThisItem.Title, //DisplayMode Property
DisplayMode.View,
DisplayMode.Edit
)
Where,
- varCheck = Power Apps Variable Name
- gal_EmployeeDepartments = Power Apps Gallery Name
5. In the last, insert a Text input control and set its Default property to the code below.
Default = LookUp(
'Product Details',
Title = chk_Departments.Text
).Price
Where,
- LookUp() = This function uses LookUp to find a single record that matches one or more criteria
- ‘Product Details’ = SharePoint Online List
- chk_Departments = Power Apps Checkbox Name
- Price = SharePoint list Currency Column
6. Save, Publish, and Privew the app. Whenever the user selects any product name from the checkbox control inside the gallery, the Text input control displays the selected product price as in the screenshot below.
This is how to set a PowerApps checkbox value from the SharePoint list.
Power Apps If the Checkbox is Checked
In this section, I will explain the Power Apps if the checkbox is checked with a simple scenario:
Scenario:
In Power Apps, there is a Checkbox control, a Button control, and a Text label. Whenever the user clicks on the button control, the text label will display the text, i.e., [Check is Checked or Check box is Not Checked] based on the check box selection [If checked or not].
Refer to the below screenshot:
To do so, follow the below steps.
1. On the Power Apps Screen -> Insert a Checkbox control and set its Text property to the code below.
Text = "Terms and Conditions"
2. Then, insert a Button control and set its OnSelect property to the code below.
OnSelect = Set(
varChecked,
If(
chk_Selected.Value = true,
"Check Box is Checked",
chk_Selected.Value = false,
"Check Box is Not Checked"
)
)
Where,
- varChecked = Power Apps Global Variable Name
- If() = The Power Apps IF() Function performs a logical comparison to see if the result is true
- chk_Selected = Power Apps Checkbox name
3. Next, insert a Text label and set its Text property as:
Text = varChecked
4. Once your app is ready, Save, Publish, and Preview the app. When the user clicks on the button control, the text label will appear with text based on the checkbox selection [If Checked or Not] as in the screenshot below.
This is all about the Power Apps if the checkbox is checked.
Power Apps Checkbox Checked Value
In the last, we will see the Power Apps checkbox checked value with a simple example:
Example:
I will also take the above SharePoint Online List [Product Details] for this example. In Power Apps, there is a Gallery control having the SharePoint list “Title records”, a Button control, and a Text label.
Whenever the user selects a check box value or values and clicks on the button control, the text label will display checkbox checked values as in the screenshot below.
To do so, follow the below steps. Such as:
1. On the Power Apps Screen -> Insert a Gallery control and set its Items property as:
Items = 'Product Details'
Where,
- ‘Product Details’ = SharePoint Online List
2. Then, insert a Checkbox control inside the gallery and set its Text property to the code below.
Text = ThisItem.Title
3. Then, insert a Button control and set Its OnSelect property to the code below.
OnSelect = Set(
varCheckedItems,
Concat(
Filter(
gal_Products.AllItems,
chk_ProductNames.Value
),
Title & ","
)
)
Where,
- varCheckedItems = Power Apps Global Variable Name
- gal_Products = Gallery Control Name
- chk_ProductNames = Check Box Name
- Title = SharePoint List Text Field
4. Next, insert a Text label and set its Text property as:
Text = varCheckedItems
5. Save, Publish, and Preview the app. When the user selects a check box value or values and clicks on the button control, the text label will display checkbox checked values like below.
This is all about the Power Apps checkbox checked value.
Conclusion
From this Power Apps tutorial, we learned all about the Power Apps checkbox value. Here, we discussed what the Power Apps Checkbox control is and what are the properties of a Power Apps checkbox control.
Then, we saw how to add a checkbox control in the Power Apps and Power Apps checkbox value manually.
Moreover, we also covered the below topics. Such as:
- How to set Power Apps Checkbox Value from SharePoint List
- PowerApps if Checkbox is Checked
- Power Apps Checkbox Checked Value
You may also:
- How to Patch Power Apps Collection to SharePoint List?
- Display SharePoint List Items in PowerApps Gallery
- Power Apps Show Image from SharePoint List
- Power Apps Uncheck Checkbox When Another is Checked
- Power Apps Visible if Checkbox is Checked
I am Bijay a Microsoft MVP (10 times – My MVP Profile) in SharePoint and have more than 17 years of expertise in SharePoint Online Office 365, SharePoint subscription edition, and SharePoint 2019/2016/2013. Currently working in my own venture TSInfo Technologies a SharePoint development, consulting, and training company. I also run the popular SharePoint website EnjoySharePoint.com
Thank you a lot for this detailed description 🙂
Hi Bijay, I have yes/No column on sharepoint column and I want to use check and uncheck on poweApps but it is not working do you have some idea, when we add yes on sharepoint the powapps by default checked unless unchecked
So much information here, excelent article
Hi Bijay, Good knowledge. I am a new PowerApper and would like to have your help. I have Choices column with multiple selections. I would like to populate the value in Checkbox control within Gallery control. There are 9 choices for that column. If my sharepoint list record has only 3 values, how can we display those 3 choices checked while the other 6 check boxes unchecked. Thanks.