web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / patch yes/no from shar...
Power Apps
Unanswered

patch yes/no from sharepoint form

(0) ShareShare
ReportReport
Posted on by 557

I have a toggle switch where id like for info to patch to a column in SharePoint if the toggle is turned on.  The SP table is called 'ecom Intake' and I'd like for the column NeedMoreInfoOPS_Current to update to "Yes" and to "No" if turned off.  having some difficulty with the formula below.  Any help ia appreciatedScreenshot 2024-05-14 143706.png

Categories:
  • RogierE Profile Picture
    879 Moderator on at

    As you are using the SharePointIntegration, I’m guessing that you created this app as a customized form for a SharePoint list. 
    The easiest way to solve your requirement would be to stick to the Form and not create your own toggle. This way, patching your data back to the list would be executed by the submitform that comes standard with your sharepointintegration and the save button that you hopefully kept. 

    So I would propose:

    • make your column a yes/no column in SharePoint 
    • Add the column to the chosen fields in the form SharePointForm1

    and off you go! 
    As Boolean columns create a field with a toggle out of the box, no need to create your own patch formula. 😊

     

    Please LIKE the reply and ACCEPT it as the solution if the answer is what you were looking for.
    (to help me grow in community rank and help others find the solution)

  • Gochix Profile Picture
    1,937 Moderator on at

    @joel914823 ,

     

    Your patch function is missing any information which record it must Patch.

    If(
     Toggle1.Value = true,
     UpdateIf(
     'eCom Intake',
     ID = DataCardValue,
     {NeedMoreInfoOPS_Current: "Yes"}
     ),
     UpdateIf(
     'eCom Intake',
     ID = DataCardValue,
     {NeedMoreInfoOPS_Current: "No"}
     )
    )


    DataCardValue is where your record ID is in the form.
    _____________________________________________________________________________________
    Please give a thumbs up if I resolved your issue! Please click Accept as Solution to close the topic!


  • joel914823 Profile Picture
    557 on at

    @Gochix I am using this as a customized form for a SharePoint list. I'm struggling with with DataCardValue I would tie it to?Screenshot 2024-05-14 153358.png

  • joel914823 Profile Picture
    557 on at

    @Gochix I am using this as a customized form for a SharePoint list. I'm struggling with with DataCardValue I would tie it to?Screenshot 2024-05-14 153358.png

  • Gochix Profile Picture
    1,937 Moderator on at

    @joel914823 ,

     

    Add another field in your form that contains ID.
    You can hide it later if you wish, but for now leave it displayed. Copy the name of that DataCard where ID is displayed and change it in the formula.

    ID = DataCardValue <<-- 


    _____________________________________________________________________________________
    Please give a thumbs up if I resolved your issue! Please click Accept as Solution to close the topic!



  • joel914823 Profile Picture
    557 on at

    Thanks @Gochix     do I need to add to the datacardvalue15?  I see the error states they have to be of the same type?  Screenshot 2024-05-14 162537.png

    joel914823_0-1715718399446.png

     

     

  • Gochix Profile Picture
    1,937 Moderator on at

    try:

    If(
     Toggle1.Value = true,
     UpdateIf(
     'eCom Intake',
     ID = DataCardValue15.Text,
     {NeedMoreInfoOPS_Current: "Yes"}
     ),
     UpdateIf(
     'eCom Intake',
     ID = DataCardValue15.Text,
     {NeedMoreInfoOPS_Current: "No"}
     )
    )


    _____________________________________________________________________________________
    Please give a thumbs up if I resolved your issue! Please click Accept as Solution to close the topic!

  • joel914823 Profile Picture
    557 on at

    @Gochix no luck - still gives the same error message. 

  • RogierE Profile Picture
    879 Moderator on at

    @joel914823 have you tried this alternative? 

  • Gochix Profile Picture
    1,937 Moderator on at

    @joel914823 ,

    How does your DataCardValue15 looks like, can you provide a screenshot and if this is a custom form then what's the Default property of this DataCardValue15?


    _____________________________________________________________________________________
    Please give a thumbs up if I resolved your issue! Please click Accept as Solution to close the topic!

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 432 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 347

#3
WarrenBelz Profile Picture

WarrenBelz 254 Most Valuable Professional

Last 30 days Overall leaderboard