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 / Checkbox in datacard c...
Power Apps
Unanswered

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

(0) ShareShare
ReportReport
Posted on by

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.

Categories:
I have the same question (0)
  • Verified answer
    v-xida-msft Profile Picture
    on at

    Hi @Anonymous ,

    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 Power Platform Member Profile Picture
    on at

    @v-xida-msft 

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

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard