Hello,
I am trying to create a scenario that will create a new customer in Square when a customer fills out a from on my website, but only if the customer does NOT already exist in Square.
I have everything working but cannot seem to figure out how to create a filter to test if the customer already exists.
I have a Square module that lists all the existing customers followed by a Square module to create a customer. I need to setup a filter between the 2 that will test if the form data already exists in the Square customer list and if it doesn’t exist, passes it on to the Create Customer module. The test we will be using will be the email address.
Any help would be appreciated.
Thanks!
Welcome to the Make community!
The Square integration on Make does not have a Search Customers module, which is what you would normally use to check if an email exists. This Search Customers endpoint already exists on Square.
I’m sure others would agree that this is a nice feature to have.
You can submit this suggestion to the Idea exchange, under App improvement ideas.
Don’t forget to search for it first, just in case someone already suggested it, so that you don’t end up creating a duplicate.
If the external service has a Developer API Reference/Documentation then you should be able to integrate the endpoints in Make using the app’s universal module (Make an API call) or generic HTTP “Make a request” module, something like this:
Then, to create a customer only when there are no results, take a look at this example:
That’s what the error directive Resume allows you to do. First, you use a Search module to see if it exists, then Create a new item if it doesn’t exist. In the Create field, you use an if-statement to “ignore” a required field if there are search results, throwing an error and allowing you to “skip” the creation module.
The if
(not-exist-create-ignore) throws the error (ignore if exists), which the Resume directive can be used to return the item from the Search module (to check if it exists).
I explained this in a similar older post Can I skip a module based on a filter? - #3 by samliew
3 Likes
Thanks for your suggestion. Below is what I ended up doing with the filter sitting before the Square “Create a customer” module.
1 Like