How can I order the results by any of these fields?
I’d try to parse the date and format it as a ISO 8601-string. This allows easy sorting afterwards using the Item Lists node. To help with the parsing, n8n includes Luxon.
How can I get the records created or modified in the last 3 days?
Once you’ve parsed the dates you can do this with the IF or the Filter node.
Here’s a quick workflow defining a buch of example items using your fecha_registro date format, then sorting and filtering them:
I hope this makes sense and helps! The .fromFormat() method I am using here can parse pretty much anything. If you ever need to parse another format you can find all available tokens describing a date format here.
Thank you so much for your response and the advice on sorting the results. I will definitely consider that option as it might be helpful.
I understand that fetching all the records could be costly, so I need to utilize the native filters of n8n’s DynamoDB module to bring fewer records per query.
Hey @Jorgelig, you can also use filter expressions which you already seem to do as per your screenshot. This isn’t n8n specific-functionality though (n8n would simply send your expression to the AWS API), so you’d want to check out the AWS documentation for more information here: