Hello
I am trying to retrieve the latest record once inserted into dataverse using the collect method.
Here is the code that im using to try and retrieve the data into a gallery.
Last(SortByColumns(Filter('Stagings','Employee Code'=TextInputEmployeeCode.Text, 'Generic Entry'="Record Entered"),"dlg_genericentry",Descending))
But this seems to not pick up the latest records every time, only sometimes which i'm finding strange. So sometimes it will pick up the second latest record instead of the latest.
I've also tried -
Last(SortByColumns(Filter('Stagings','Employee Code'=TextInputEmployeeCode.Text, 'Generic Entry'="Record Entered"),"dlg_genericentry",Ascending))
First(SortByColumns(Filter('Stagings','Employee Code'=TextInputEmployeeCode.Text, 'Generic Entry'="Record Entered"),"dlg_genericentry",Descending))
First(SortByColumns(Filter('Stagings','Employee Code'=TextInputEmployeeCode.Text, 'Generic Entry'="Record Entered"),"dlg_genericentry",Ascending))
The same thing happens with these formulas^
As you can see in the screenshots, the record from 4:59pm is being retrieved in the gallery but the record from 5:00pm should be retrieved because its the latest record in the table.
A flow creates the log out record and the login record is created inside the powerapp if this matters.
I hope someone can help!
Much appreciated