Hi,
I have recently started using Zapier to transfer new orders from my website to an obscure book-keeping software called Kashflow. It has a Zapier integration, although there are some things it does not cover.
Each customer on Kashflow requires a unique customer code. By default, Kashflow autogenerates the code from the first four letters of the first name followed by a number that autoincrements if there are existing customers with that code (e.g. "John Smith" -> "JOHN56" if there are 55 Johns already on Kashflow).
I wanted a code template that was less simple, so when manually entering customers on Kashflow I used the first four letters of the surname, the first letter of the first name, and a number (e.g. "John Smith" -> "SMITJ9"). There is a button with JScript on Kashflow that increments the number on a duplicate.
The Zapier Kashflow integration lets you set the customer code. It was easy to use Formatter to truncate the surname and first name for the code. I tried putting the number "1" at the end of the field, hoping that Kashflow would automatically increment it in the case of a duplicate code. However, Zapier would stop the process as soon as a duplicate customer code was found, and the customer was not created on Kashflow.
I found it is possible to use Paths to work around to a limited extent. I can use the Kashflow search integration to check if there is a customer with the same code before creating the customer and invoice. If there is a customer with the same code, then Storage by Zapier increments the code number by 1, and then there is another Kashflow search to see if the customer code is in use (see attachment for a simplified basic visual representation of what it looks like).
The problem with this is that without some way to conditionally loop this series of steps, I would need to duplicate all of the subsequent steps ad infinitum to make sure I prevent Zapier encountering a duplicate code. Also, if I wanted to make a single change to any of the downstream steps I would need to copy it over to all the duplicate steps.
Any suggestions on more elegant ways to address this problem would be much appreciated.