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.
Thank you timl, this works well
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()
}
)