I have files in a google drive directly, which the flow reads in, and then a loop will process through each file name one at a time, and add some information to a google sheet. However, after a specific number of files, a date needs to be changed in the google sheet column, and incremented by one day.
By example - the file list is traversed, a filename and file details are added to a row in the google sheet, and a date is added to that row. After the loop runs 3 times, then the date must be incremented by one day, and the process continues.
My problem is, that when using the āputā from persistent storage, the data is set to 3, and I decrement it by one after each loop, but for some reason, when testing that with the āif/thenā it seems to never actually do anything.
basically Iām trying to create a āif x>0 then doā¦elseā kind of situation, where x is reduced each run of the loop.
Is there some way to do this with Activepieces, or do I have to use the code part to achieve this?
Thatās great - I am actually attempting to do precisely as you have done, but for some reason, it doesnāt seem to be working. Iām looking further into it, and will update shortly if I am able to determine what is causing it to ignore my stored counter value after I do the subtraction operation and storage.
Somewhat frustrated by all this. As the counter never seems to change.
Couple questions:
Iāve set the actual object to the scope of āFlowā, as I donāt want the variable to be stored on a project scope as it will change each time the flow runs based on data provided by the trigger.
Are there any examples of how this works, or tutorials I can review - as I feel so absolutely clear that Iāve done everything correctly, yet the counter simply never changes itās value, even after doing the āmathā operation on it, and then storing it again using āputā ā¦
Iām quite frustrated, so any guidance you can give is appreciated.
Hello buddy, sorry for your frustration, can you let me know how you tested the counter and how it didnāt work ?
like did you test the step multiple times ? or did you test the flow multiple times and it is not working after being published and really triggered, also can you please share your flow with me ? just click on the chevron next to the flows name in the builder or the three dots next in the flowsā table to share it.
You could export it if you are self hosting.
Thanks so much - Iāve messaged you with the flow.
Hopefully there is an easy solution, and I can post the solution here to ensure anyone else running into this issue is able to benefit from any resolution we come up with.
Thanks so much for taking the time to provide that. You are correct, and as it turns out, it all comes down to the āscopeā and the āGetā operation with persistent storage prior to making reference to in it in the following piece (at least, this is what I determined after working through the problem).
So - for anyone else who does have the issue I was facing, itās worth keeping a close eye on the scope of the persistence (flow vs. project), and also using the Get operation of the Persistent Storage piece prior to making additions/subtractions or other operations on it.
I was of the misguided impression that once I had initially placed the key/value pair into persistent storage using the āputā action, that it could easily be referenced in any other piece by just using the key of the object. While that is logical, it appears it is still important to retrieve the object with āgetā prior to other operations on it when working within a branch or loop.
Hope that makes sense.
Thanks so much @Flickerko for your flow - this outlines everything brilliantly!