Skip to content
Advertisement

Javascript list_pop on Zapier Storage

I’m a heavy user of the Zapier Store in code blocks (Javascript).

Recently the data sent to the storage encountered a sudden increase and sometimes I got a full store (cleaning it everyday does not help).

I wanted to adopt a FIFO approach, for which if the number of records in the store > 450, I would delete the first record created in the Store.

I’ve been trying the following:

JavaScript

But I had no success. I guess the list_pop method is for Python only.

Did anybody try something like this and found the solution?

Does anybody have a better idea?

Thanks a lot!

Advertisement

Answer

I solved it: the problem was in the way the storage was set up and in the need for a PATCH request.

To add elements:

JavaScript

You will get a repository that looks like this:

JavaScript

To pop elements from the top of the list:

JavaScript

Thanks!

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement