Task assigning based on Auto Increment

I`d like to run a task ( send a customized mail) based on the auto increment number created by Knack. For example

Number 1000 generates a task that sends an email to email account A

Number 1001 generates a task that sends an email to email account B

Number 1002 generates a task that sends an email to email account A

Number 1003 generates a task that sends an email to email account B

and so on

Anyone an idea how that can be achieved?

Hi Derek,

thanks so much for your attention - I had a feeling from the beginning that there must be something that could be done with division by 2 - but could not get to the ground of it. Iam sure your initial algorithm would work for my problem ( had already trials run with it) but the second solution you found seems even simpler!

Will get that into place and - problem solved!

Cheers, Ulf

What do you know -- there is a modulus function! For your formula, you would simply use {Auto Increment}%2 to end up with a 0 (for even) or 1 (for odd).

If you are looking for an odd/even type of thing, I would recommend creating an equation formula that uses mod/2, but since they don't actually have a modulo function, you can emulate it by creating 3 equation formulas as such:

  1. create an equation formula that is Auto Increment / 2 with rounding at 1 decimal place
  2. create an equation formula that is result from #1 rounded DOWN at 0 decimal places
  3. create an equation formula that subtracts #2 from #1 and multiply by 2
  4. The end result should be a 0 (for even number) or a 1 (for odd number)
  5. Then you could create 2 tasks: 1 that fires for a 0 result and 1 that fires for a 1 result.

You may also want to create a task that updates a "Emailed" field (you'd need to add that as well) and runs shortly after the above tasks to prevent the emails from going out all over again.

(ie: email based on odd or even at 10pm, update "Emailed" field on records to "Yes" at 11pm. That way when it runs next time you only have to add a criteria to the tasks for odd and even to Where Emailed = No)

To my knowledge they have not implemented a "mail AND update record" yet, but here's hoping! :D

I hope I understood you correctly and showed you a way around it.

Best regards

UPDATE: I played around a bit more and made a 1 field entry to retrieve 'odd' or 'even' for you:

(round({Auto Increment}/2,0)-({Auto Increment}/2))*2 is the formula.