cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
FelipeCaru
Level 8

Checkbox in datacard changing value of Excel source when selected/unselected

Hello all,

I have a question regarding check box. I have as an original datacard, an input text box with value 0 as default. What I want to do is to change that text box for a checkmark, so if it is selected, it will change value to 1, if unselected, value 0.

completadoCheck.png

What should I edit from the properties in there? Or is it somewhere else? As seen, I kinda tried by changing the "oncheck" but seems I did not do it correctly, if it is even like that.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Checkbox in datacard changing value of Excel source when selected/unselected

Hi @FelipeCaru ,

Could you please share a bit more about your scenario?

Do you want to change the Completado column to 1 if the Checkbox is selected when you submit your form data?

 

Based on the operation that you done within your Edit form, I think there is something wrong with it. I have made a test on my side, please take a try with the following workaround:

Within the Edit form of your app, set the Update property of the Completado Data card (Compledato_DataCard1) to following:

If(
   DataCardValue3.Value = true,   /* <-- DataCardValue3 represents the Checkbox control in your Edit form */
   1,
   0
)

Set the Default property of the DataCardValue3 (your Checkbox control) to following:

If(
   ThisItem.Completado = 1,
   true,
   false
)

then when you submit your form data (using SubmitForm() function), the corresponding Completado column in your Excel table would be updated.

 

In addition, if you want to directly update the correspoding Completado column in your Excel table when you check/Uncheck the Checkbox rather than use SubmitForm function, I think the Patch function could achieve your needs.

I have made a test on my side, please take a try with the following workaround:

Set the OnSelect property of the Checkbox (DataCardValue3) to following formula:

If(
   DataCardValue3.Value = true,
   Patch(
             'YourExcelTable',
             BrowseGallery.Selected,
             {
              Completado: 1
             }
   ),
   Patch(
             'YourExcelTable',
             BrowseGallery.Selected,
             {
              Completado: 0
             }
   )
)

Set the Default property of the DataCardValue3 (your Checkbox control) to following:

If(
   ThisItem.Completado = 1,
   true,
   false
)

More details about Patch function in PowerApps, please check the following article:

Patch function

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Community Support Team
Community Support Team

Re: Checkbox in datacard changing value of Excel source when selected/unselected

Hi @FelipeCaru ,

Could you please share a bit more about your scenario?

Do you want to change the Completado column to 1 if the Checkbox is selected when you submit your form data?

 

Based on the operation that you done within your Edit form, I think there is something wrong with it. I have made a test on my side, please take a try with the following workaround:

Within the Edit form of your app, set the Update property of the Completado Data card (Compledato_DataCard1) to following:

If(
   DataCardValue3.Value = true,   /* <-- DataCardValue3 represents the Checkbox control in your Edit form */
   1,
   0
)

Set the Default property of the DataCardValue3 (your Checkbox control) to following:

If(
   ThisItem.Completado = 1,
   true,
   false
)

then when you submit your form data (using SubmitForm() function), the corresponding Completado column in your Excel table would be updated.

 

In addition, if you want to directly update the correspoding Completado column in your Excel table when you check/Uncheck the Checkbox rather than use SubmitForm function, I think the Patch function could achieve your needs.

I have made a test on my side, please take a try with the following workaround:

Set the OnSelect property of the Checkbox (DataCardValue3) to following formula:

If(
   DataCardValue3.Value = true,
   Patch(
             'YourExcelTable',
             BrowseGallery.Selected,
             {
              Completado: 1
             }
   ),
   Patch(
             'YourExcelTable',
             BrowseGallery.Selected,
             {
              Completado: 0
             }
   )
)

Set the Default property of the DataCardValue3 (your Checkbox control) to following:

If(
   ThisItem.Completado = 1,
   true,
   false
)

More details about Patch function in PowerApps, please check the following article:

Patch function

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

FelipeCaru
Level 8

Re: Checkbox in datacard changing value of Excel source when selected/unselected

@v-xida-msft 

Thank you, that was (the first part) what I was looking for (:

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,431)