The maximum number of arguments for the if function: 3

Hey team,
Getting this error:


Can anyone explain why?

To give more context…
Basically I have an iterator inside of an iterator.


I’ve had issues (due to my attempt at a workaround on the wait queue) with one of my integrations - When a time entry is created in Toggl it creates a time entry in our project management software. It works 99% of the time all fine, but every now and again when a scenario takes a little bit longer than planned it’ll accidentally create a duplicate. Once the proper wait queue is sorted then that’ll fix the issue, but in the meantime I’m creating a weekly check to see if the time entries for the week logged in Toggl are significantly different to the time entries logged in Scoro and then it’ll send me an email every Monday with the days and users that have issues.

So that’s the context. The first iterator has an array of the different users. Then the next iterator goes through day by day checking (because I can’t get a daily time summary from Scoro like I can with Toggl). If there is a time difference of more than 5 minutes that day, then it should be adding it to the set variable. It then does that every day of the week and sends me a slack message (which will eventually be an email once I’ve finished debugging) with what days each user has a discrepancy which will save me having to manually check each week.

I was originally doing it by adding each new date to an array.


That kinda worked but when it got to going through the dates for the next user it’d keep the dates from the last user and I’d get duplicates.

So then I tried destroying the data inside the SetVariable (or wiping it to nothing) at the end of each slack message being send before it iterated again

But then it wouldn’t use the add operator because it through it had a string in it. So now I’m trying to do just create a CSV that I can turn into an array with javascript later but each time the index on node 30 goes back to 0 it starts fresh. That’s where this error came up.

I guess another version of this question that’d get the same outcome is can you destroy a variable somehow?

The waiting queue is already being tested, and I hope that soon you won’t need to rely on workarounds anymore.

I’ll be back soon, and we’ll go over your questions. :pray:

Just a quick update. If I add a null into the value field it wipes it enough for the “add” function to work again. But as I go through it more I now want to add two values into that array (the difference as a time value for that day and the date). Ideally I want each one to have a key/value pair so I’ve shifted now to have a javascript node between them that parses it into json instead and that does the joining which is working better so I guess we can call that sorted.

But the original question still remains around the max arguments error, because I would have thought it would work.

To merge two strings into one, use the green [+] button from the helper widget.

Like this:

Thanks Oleg. What I was trying to do here though is basically turn it into a CSV. So if true then return just the $2.aa. If false then return $2.aa,string.

So if it’s the beginning of the chain then it wipes the data in there basically and replaces it with just a single value, and then for all values after that it adds a comma and the string to create a CSV

This is the way
CleanShot 2025-02-07 at 10.41.02

1 Like

Full input:
CleanShot 2025-02-07 at 10.42.07