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 / Collection vs Patch
Power Apps
Answered

Collection vs Patch

(0) ShareShare
ReportReport
Posted on by 725

Hi everyone

This works

Patch(BSInspections,Defaults(BSInspections),{StationNum:{Id:NumT.ID, Value:NumT.StationNumber}},{BaitLeft:BLeft},{BaitAdded:BAdded},{Faeces:FaecesYN},{InspectionDate:Today()})

But this does not

Collect(ColStation,{StationNum:{Id:NumT.ID, Value:NumT.StationNumber}},{BaitLeft:BLeft},{BaitAdded:BAdded},{Faeces:FaecesYN},{InspectionDate:Today()})

 BLeft, BAdded, Faeces are  true false Set() variables, Do Collections not like Set() variables? I'm not getting errors but the collection just shows the date and BLeft, BAdded, Faeces all as false.

Thank you for your time.

Categories:
I have the same question (0)
  • Verified answer
    timl Profile Picture
    36,770 Super User 2026 Season 1 on at

    @Corissandageri 

    Syntactically, this formula adds a new record to BSInspections. It merges all the fields that you specify after Defaults(BSInspections) into a single new record.

    Patch(BSInspections,Defaults(BSInspections),{StationNum:{Id:NumT.ID, Value:NumT.StationNumber}},{BaitLeft:BLeft},{BaitAdded:BAdded},{Faeces:FaecesYN},{InspectionDate:Today()})

    In contrast, this function would add 5 records to the ColStation collection. Therefore, these two calls are not equivalent.

    Collect(ColStation,{StationNum:{Id:NumT.ID, Value:NumT.StationNumber}},{BaitLeft:BLeft},{BaitAdded:BAdded},{Faeces:FaecesYN},{InspectionDate:Today()})

    The formula beneath would behave the same as your Patch example.

    Collect(ColStation,
     {StationNum:{Id:NumT.ID,Value:NumT.StationNumber},
     BaitLeft:BLeft,
     BaitAdded:BAdded,
     Faeces:FaecesYN,
     InspectionDate:Today()
     }
    )

     

  • R Bakker Profile Picture
    725 on at

    Thank you timl, this works well

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 509 Most Valuable Professional

#2
Haque Profile Picture

Haque 302

#3
11manish Profile Picture

11manish 265

Last 30 days Overall leaderboard