Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building 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:
  • RezaDorrani Profile Picture
    12,141 on at
    Re: Patching sharepoint list issue

    Hi @russrimm 

     

    what type of variable is myitem

     

    is it a record , a collection , a string?

  • russrimm Profile Picture
    Microsoft Employee on at
    Re: Patching sharepoint list issue

    @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,141 on at
    Re: Patching sharepoint list issue

    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
    Re: Patching sharepoint list issue

    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,141 on at
    Re: Patching sharepoint list issue

    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

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,594 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,928 Most Valuable Professional

Leaderboard