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 / Problem with Patch and...
Power Apps
Answered

Problem with Patch and Toggle switch

(0) ShareShare
ReportReport
Posted on by 11

Background:
Excel table stored in Sharepoint, which is populated in turn from a MS Bookings application via a Automated flow.
I created a vertical gallery (blank) and added my fields (BookTime, Name, ID, Email)
I added a toggle switch (AttendedToggle) which will set "Yes" into the Attended field (text)

True text value is "Yes" and false text value is "No"
Toggle switch default 

 

 

If(IsBlank(ThisItem.Attended), false, true)

 

 

My OnCheck value is:

 

 

Patch(
 MyTable,
 Filter(MyTable,Email = ThisItem.Email),
 {
 Attended:Text("Yes")
 }
)

 

 

And this does not work. I tested the Patch by adding 

 

 

Defaults(MyTable),

 

 

and the script works perfectly, and adds a new row with "Yes" in the Attended column.

What am I doing wrong here please?

 

Categories:
I have the same question (0)
  • Verified answer
    Rajkumar_M Profile Picture
    3,747 Moderator on at

    Hi @JulianTaylorUCL 

     

    Make sure that the Attended field in the SharePoint list is a text field, as the toggle switch is set to update the field with a text value ("Yes"). If the Attended field is a different data type, such as a boolean or number, the toggle switch may not be able to update the field correctly.

     

    Patch(
    MyTable,
    Filter(MyTable, Email = ThisItem.Email),
    {
    Attended: true
    }
    )

    Thanks!

     

    If my response has been helpful in resolving your issue, I kindly request that you consider clicking "Accept as solution" and "giving it a thumbs up" as a token of appreciation.

     

  • mbarbosa Profile Picture
    146 on at

    You can also verify that the Email string you're comparing is Ok. Because if it adds a new line, maybe the problem is that is not finding the correct line to patch because of the email comparison.

  • JulianTaylorUCL Profile Picture
    11 on at

    Many thanks. I identified the problem as being a connectivity issue between PowerApps and the Excel spreadsheet where I was using the MS Bookings Booking_id as the ID for each row. I changed that to using  __PowerAppsId__ and was able to get it running fine using

    Patch(
     MyTable,
     ThisItem,
     {Attended: AttendedCheckBox.Text}
    )

     

    Thanks for your help!

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 150 Super User 2026 Season 2

Last 30 days Overall leaderboard