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 / Patching sharepoint li...
Power Apps
Unanswered

Patching sharepoint list issue

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi all,

I'm trying to patch a sharepoint list and I can't seem to get the toggle column to flip.  If the record doesn't exist yet, it's creating it successfully and the toggle is flipped to true like I want.

If the record already exists and the toggle just needs flipped from false to true, it's not flipping.  

My default value for the toggle is "checkintoggle".

I've confirmed that "myitem" is null when the entry doesn't exist yet, and is populated when it does.

Thanks in advance

 

My button's onselect is:

UpdateContext({checkintoggle:true});Set(myItem,LookUp('Registration Form', 'Full Name'=FullNameCell.Text && 'EventDate' >= DateAdd(Today(),-7)));
If(IsBlank(myItem),
Patch('Registration Form',Defaults('Registration Form'),{'Full Name':FullNameCell.Text,'E-Mail':EmailCell.Text,City:CityInput.Text,State: StateInput.Text,Title:VenueInput.Text, 'EventDate':EventDatePicker.SelectedDate,'Checked In?':checkintoggle,'CaptainEmail':varCaptain,'FromDomain': DomCell.Selected.Value}),
Patch('Registration Form',myItem,{'Full Name': FullNameCell.Text,'E-Mail':EmailCell.Text,City:CityInput.Text,State: StateInput.Text,Title:VenueInput.Text,EventDate:EventDatePicker.SelectedDate,'Checked In?':checkintoggle,'CaptainEmail':varCaptain,'FromDomain': DomCell.Selected.Value})
);UpdateContext({ShowDialog:true})

Categories:
I have the same question (0)
  • RezaDorrani Profile Picture
    12,145 on at

    hI @russrimm 

     

    Yes/No type columns in SharePoint need to be patched with values 0 and 1

    0 - false

    1 - true

     

    Regards,

    Reza Dorrani

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

  • russrimm Profile Picture
    Microsoft Employee on at

    Hi @RezaDorrani thanks, so the column name is "Checked In?".  So in my Patch I tried 'Checked In?':1 and I tried Value("1"), nothing seems to patch the toggle.  I even set the toggle default to an updatecontext and made the toggle visible so I could see it's behavior.  When I click the button, I see the toggle flip but no go.  I also tried setting the 'Checked In?' column value to CheckedToggle.Value since the toggle's object name is CheckedToggle.  It seems like the true side of my If(IsBlank(myitem) is running but the false side never does for some reason?
    @RezaDorrani wrote:

    hI @russrimm 

     

    Yes/No type columns in SharePoint need to be patched with values 0 and 1

    0 - false

    1 - true

     

    Regards,

    Reza Dorrani

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly


     

  • RezaDorrani Profile Picture
    12,145 on at

    Hi @russrimm 

     

    Add 2 labels (for testing purpose)

     

    label1 text - IsBlank(myItem)

    label2 text - IsEmpty(myItem)

     

    this will help you to check the actual values of these conditions

  • russrimm Profile Picture
    Microsoft Employee on at

    @RezaDorrani They're both false as expected.  So I think there's something wrong with the way it's finding my baserecord.  When I look at the value of "myitem" it even shows the exact record I'm expecting it to update.

  • RezaDorrani Profile Picture
    12,145 on at

    Hi @russrimm 

     

    what type of variable is myitem

     

    is it a record , a collection , a string?

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 528

#2
WarrenBelz Profile Picture

WarrenBelz 416 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 306

Last 30 days Overall leaderboard