Modulo Issue in API Workflow Only When Statement [SOLVED - unrelated issue]

I have an API work flow which will loop through my Expense Entries. Nested within that loop is another loop which loops through a series of months based on the Start Date & End Date of the Expense Entry.

Expense Entry Example

The nested loop has 4 steps. Each of these steps creates a new Expense Model. But each of these steps have a different ONLY WHEN condition based on the interval & it’s interval value (One Time/0, Monthly/1, Quarterly/3, Annually/12). The Only When for step 1 and step 2 representing One Time (Only When Start Date = Date) and Monthly (none required besides the interval).

I have a problem with my Quarterly / Annual one. Here is the image:
Only When

  • expense’s Interval is Search for Intervalss’s Interval:first item - this is the exact same as step 1 and 2 which work. I’m basically just checking that the expense’s interval is equal to the QUARTERLY interval

  • and date’s Date Value - expense’s Start Value ← modulo → Search for Intervalss:first item’s interval_number is 0 - This is where the trouble must lie. A date value or start value = year * 12 + month. So 2020-01 is 2020*12+1 = 24241. So if I’m running through dates of 2020-01 to 2020-06 then the modulo should =0 when the date is 24241 & 24244 (ie. date value of 24241 - start value of 24241 modulo 3 = 0). However, it only creates a new Expense Model for 24241 (2020-01) and not for 24244 (2020-04) . No idea why.

Thank you in advance!

Well, this is embarrassing…

Nothing was wrong at this end of my app. The issue was when I inputted the Expense Entry as a thing, I was recording the End Value for the corresponding Start Value. Oddly enough, this only happened for the 2nd 2 entries but not the first 2 resulting in the API working for some Entries but not others.


This topic was automatically closed after 70 days. New replies are no longer allowed.