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 / Updating a Sharepoint ...
Power Apps
Unanswered

Updating a Sharepoint List field value with a toggle "On Check" Property

(0) ShareShare
ReportReport
Posted on by 194

Hello,

I have a form that is connected to a Sharepoint List. In this form, I have a card with a value that I want to update in case somebody toggles a switch - so only if the action is performed (OnCheck I believe).

The card in question is connected to a Choice field in Sharepoint (TEXT values).

 

I am very new to Power App - I cannot figure out how to do it! I tried with PATCH but probably my syntax is not correct (and maybe it's not even PATCH that I need to use?)

 

Thanks a lot for pointing me into the right direction!

Kind regards

Valeria

 

Categories:
I have the same question (0)
  • HenriDesmet59 Profile Picture
    295 on at

    Hello @ValeriaBreve ,

     

    So you have a Toggle and a dropdown field that's It ?

    What you can do is to go in the "Update" parameter of your datacard. 

    Then you can write an If condition to check if the toggle is toggled or not. If It is, then you put the datacardvalue in the true part of the condition. 

    If you don't want the update, you can only write the true part and not the false part :

     

    If(toggle.value = true, datacardvalue10.selected)

     

    Tell me if It's works 🙂 

     

    Henri 

  • ValeriaBreve Profile Picture
    194 on at

    Hi Henri, thanks, no I do not want to set the value based on the value of the toggle - I want to only update the value if somebody performs the action of switching the toggle on or off. This is why I wanted to trigger the action of updating the field from the OnCheck (and OnUncheck) property of the toggle. 

    But I am at a loss for how to tell PowerApp to change the value of the Sharepoint field (and on display for the user on the card)....

  • HenriDesmet59 Profile Picture
    295 on at

    ah ok so you need to immediatly update the value when the user check the toggle ?

  • ValeriaBreve Profile Picture
    194 on at

    yes exactly, and then perform no further action unless the toggle is actioned again. Where I am lost is how to tell Power App from the Toggle.OnCheck property to change the value of my other card... I don't need to send the data immediately to Sharepoint, I can wait  until the user performs a "Save". But I need to update the card with the new value after toggle switch.

  • HenriDesmet59 Profile Picture
    295 on at

    So when you toggle, a new value need to be set right ? you can use a variable to do this.

     

    In your "default" of your datacardvalue, you can put a variable. 

    Then in your "on check" of the toggle, you can update this variable with the value you want to put in your datacard.

     

    Your datacard is just a Textcontrol ?

     

     

  • ValeriaBreve Profile Picture
    194 on at

    YESSS! It works!!! Thanks 🙂 

    Now I will build on it with more logic 🙂 Thanks again!

     

  • ValeriaBreve Profile Picture
    194 on at

    OK next question: even if I put my code in the "On Check" property for the Toggle button, when I do a SubmitForm, or ViewForm, the property gets somehow triggered if the toggle box is checked and my variable gets recalculated (which I don't want). I even put a code in the OnSelect event for the "Save" button to reset the variable to the value I want, when I click it I see the variable getting the right value and immediately changing again. So this is not doing what I want... I only want the code to change the variable fire whenever the value of the Toggle button changes. Any idea how to change this? Thanks!

  • ValeriaBreve Profile Picture
    194 on at

    After much testing, it looks like I need to put the code on the "OnSelect" property of the toggle button for it to work properly and not get fired every time I change the form mode...

  • HenriDesmet59 Profile Picture
    295 on at

    ok, nice !

     

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