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 / Help creating a Filter...
Power Apps
Unanswered

Help creating a Filter and Patch combo function

(0) ShareShare
ReportReport
Posted on by 365

Hello,

 

I am trying to create a function that will update a column in a SharePoint list on a button press. The user would enter in a starting date (date picker) and time (made using several combo boxes), and an ending date and time as well as text that would be placed into the SharePoint column. The filter should narrow down any list entries within the start and end date/time and then patch the text into the column for those entries. Anyone know how I could accomplish this?

 

 
 
Categories:
I have the same question (0)
  • Thor_PPC Profile Picture
    365 on at

    filterpatch.PNG

  • mdevaney Profile Picture
    29,991 Moderator on at

    @ngreen 

    I am a little unsure of whether the SWITCH function is allowed inside UPDATEIF.  Perhaps you can give this code a test inside the OnSelect property of the button.  Make sure to change all of the control names to match your own.

     

    UpdateIf(
     your_datasource_name,
     ('Starting Date and Time' 
     >= Date(DatePicker_Start.SelectedDate)
     + Time(dropDown_startHour, dropDown_startMin)
     + Time(Switch(dropDown_AMPM, "AM", 0, "PM", 12),0,0))
     And 
     ('Ending Date and Time'
     <= Date(DatePicker_End.SelectedDate)
     + Time(dropDown_endHour, dropDown_endMin)
     + Time(Switch(dropDown_AMPM, "AM", 0, "PM", 12),0,0)),
    
     {yourColumn1: textInput_eventLabel.Text}
    )

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • Thor_PPC Profile Picture
    365 on at

    Thanks for looking into this. I'm curious if you can explain to me the reasoning behind choosing UpdateIf over a Filter and Patch. I'm still pretty new to PowerApps, so maybe there is something I don't know. But I thought we had to use Filter and Patch for lists over 2,000 entries, so that the function gets delegated to SharePoint rather than PowerApps not being able to handle processing over 2,000 entries.

  • mdevaney Profile Picture
    29,991 Moderator on at

    @ngreen 

    I'm very glad to see you are thinking about delgation here and I believe you raise a very good point!  I chose to ignore delegation since you had not listed it as a concern.

     

    UpdateIf is only a good option if you have 2,000 records or less since it cannot be delegated.  Likewise, the Filter function cannot be delegated when using Dates in the criteria.  Its quite a big omission to SharePoint delegation abilities in my opinion.  Rumor is there are plans to change that in the future.

     

    I've been meaning to do some experiments on how to overcome this issue but just haven't found the time yet...  I believe it could be done by storing dates as a Number data type like this post suggests but that seems like alot of work.  (Link: https://powerusers.microsoft.com/t5/Building-Power-Apps/Problems-with-delegation-when-filtering-by-date/m-p/319820/highlight/true#M91969).

     

    Link To SharePoint Delegation Summary:

    https://powerapps.microsoft.com/en-us/blog/sharepoint-delegation-improvements/

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

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!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 525 Most Valuable Professional

#2
Haque Profile Picture

Haque 308

#3
Kalathiya Profile Picture

Kalathiya 234 Super User 2026 Season 1

Last 30 days Overall leaderboard