Reusing data in http request

Hello!

Describe the issue/error/question

Every hour I am quering an API, which gives me a bunch of data + a unix timestamp.
I would like to use this last timestamp in the same query, in order to show only data that I haven’t received yet (anything older than the timestamp gets filtered out).
http request works fine, but when I try to reuse the data I get a 400 error
I tried the following:
http request → same http request
http request → set → http request
http request → set → no op → http request

It goes wrong everytime!

Looking forward to some help :slight_smile: THanks!

So I’m breaking my head about this.
I thought I had figured it out with the following:
image
my thinking was that the http request needs the parameter at the first instance, but as it is not yet called (the parameter is from the actual http request itself) I’ve set up an IF function.
IF the parameter exists from the http request, then use it as a paremeter for the same http request.
IF it does not exist, set a new parameter (which is just a low timestamp to get things kickstarted).

That was my expected result, however, what I get is that every time the workflow starts because of the interval, it takes the FALSE path of the IF function. My assumption is that data is deleted after a workflow (or something similar), and that’s why it does what it does. I need to find a way to store this value from the initial http request, update it after each http request, and reuse it after each workflow start triggered by the time interval.

Thanks in advance!

Ok I got it!!

Instead of reusing data, I just get the time with $now, subtract an hour and convert it to unix timestamp.
That timestamp -1h corresponds to the data I was looking for :slight_smile:

Thank you for your attention to my monologue! :,)

2 Likes

Glad we could help :grin:

1 Like