Hi All,
I have a query that returns documents with a specific name, sometimes by mistake we will have 2 or 3 files/documents with the same name, I want to make sure that my query selects the latest one added instead of the first one that it finds, how can I accomplish this?
Right now if I have 3 files with the same name it picks the first one added since its the first one the query finds.
thanks in advance
Discussion posts and replies are publicly visible
Hi Maria, you can sort the query results descending either by 'id' (PK) or by the 'created on' field to get the latest added document.
a!sortInfo( field: "id", ascending: false ) /*OR*/ a!sortInfo( field: "createdOn", ascending: false )
Thank you! It worked I appreciate it