Find latest row that matches criteria

Hello!

I’d like to ask for help on how to accomplish the following:

I have this formula: ANY(SELECT(PENDING Devices[resourceId], AND([User Email]=[email],[Device Model]=[model])))

However, i’ve been encountering some issues where there are multiple values in PENDING Devices table that match the criteria and AppSheet seems to pick the oldest one or sometimes a random selection.

How could I be able to select the value with the latest datetime found in PENDING Devices table column named firstsync and return it? So that if there are multiple values that match the query, I get back the most recent one.

Thanks!

MAXROW(“Pending Devices”, “firstsync”,AND([User Email]=[email],[Device Model]=[model])

This will get you the Key column (resourceId?) of the Pending Devices table with the maximum value in the “first sync” column where User Email]=[email] and [Device Model]=[model]

If you then need a value other than the key column, you can use LOOKUP() to get that

1 Like