How to pass current date as a value in GET request

I need to add an HTTP node to poll the list of customers that purchased today. This node will run every day and should return only the list of customers that made a purchase that day. In other word I need to be able a variable or function that can be sent as a query parameter.

For Postman I found a JS code snippet to be added to the pre-request Script section How to pass current date as a value in GET request - #2 by dannydainton - Just getting started - Postman

Any sugestion to achieve the same in n8n?

PS: I don’t know JavaScript (perhaps the sugestion is for me to learn…)

Hey @fxholl,
I don’t know the kiskadi api you are using but to use the current date in n8n you can use expressions

Everything inside expressions is javascript so it can be helpful to know about it, but for simple things like the current date you can use {{ $now }} or {{ $today }}.

Here is my sample workflow illustrating the Http Request.

1 Like

Thanks @marcus that just did the trick

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.