# Create new contact if not found in xero

**URL:** <https://community.make.com/t/create-new-contact-if-not-found-in-xero/27979>\
**Category:** Questions\
**Tags:** xero\
**Created:** [February 20, 2024, 4:02am UTC](https://community.make.com/t/create-new-contact-if-not-found-in-xero/27979 "2024-02-20T04:02:58Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ian\_Kerry](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/ian_kerry/32/9096_2.png) [@Ian\_Kerry](https://community.make.com/u/Ian_Kerry)\
**Post date:** [February 20, 2024, 4:02am UTC](https://community.make.com/t/create-new-contact-if-not-found-in-xero/27979/1 "2024-02-20T04:02:58Z")

</div>

Hi all,

I hope this is an easy one.

i have an sql query that triggers, essentially creating an invoice in xero.

All works well until i have a new venue, that isn’t currently in xero. and then of course it fails.

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/a/1/a1af3e38aeac6db11c4aef4376c4b18006fc37e6.jpeg)

Is there a way of getting make to create one? i wondered if i should use a filter, and where the contactid or name doesn’t exist then create one. but i haven’t had much luck.

could anyone point me in the right direction please .

many thanks  
ian

---

<div class="post-metadata">

**Author:** ![samliew](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/samliew/32/13327_2.png) [@samliew](https://community.make.com/u/samliew)\
**Post date:** [February 20, 2024, 4:06am UTC](https://community.make.com/t/create-new-contact-if-not-found-in-xero/27979/2 "2024-02-20T04:06:09Z")

</div>

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.

Here, in this example, I’m using Notion, but you can apply the same concept to any integration that has a Search module.

 ![Screenshot_2023-12-30_141215](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/7/8/7800b01b2222cf9f0cb59082ae0e52bd8181d418.png)

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).

![Screenshot_2023-12-30_141250](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/e/2/e23b8e00392d516305c5ef6e979358845fb806ec.png)

I explained this in a similar older post [Can I skip a module based on a filter? - #3 by samliew](https://community.make.com/t/can-i-skip-a-module-based-on-a-filter/21888/3), [Skipping a step/module - #8 by samliew](https://community.make.com/t/skipping-a-step-module/27619/8)

---

<div class="post-metadata">

**Author:** ![Ian\_Kerry](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/ian_kerry/32/9096_2.png) [@Ian\_Kerry](https://community.make.com/u/Ian_Kerry)\
**Post date:** [February 20, 2024, 5:01am UTC](https://community.make.com/t/create-new-contact-if-not-found-in-xero/27979/3 "2024-02-20T05:01:32Z")

</div>

hi Sam

Many thanks for your help.

Before I can even test it, I need to wait for the SQL to come up with a new venue first, unless there is a way around that?

but to be clear is the ‘create if no result’ module a router module?

thanks  
ian

---

<div class="post-metadata">

**Author:** ![samliew](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/samliew/32/13327_2.png) [@samliew](https://community.make.com/u/samliew)\
**Post date:** [February 20, 2024, 5:05am UTC](https://community.make.com/t/create-new-contact-if-not-found-in-xero/27979/4 "2024-02-20T05:05:14Z")

</div>

> [@Ian\_Kerry](#):
>
> Before I can even test it, I need to wait for the SQL to come up with a new venue first, unless there is a way around that?

Usually we do not use “Run an SQL statement” as the trigger module.

> [@Ian\_Kerry](#):
>
> is the ‘create if no result’ module a router module?

No, there are no routers.

One path is the normal path, and the hollow-dotted path is the error route. If you see the second link above it will be clearer.

---

<div class="post-metadata">

**Author:** ![Ian\_Kerry](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/ian_kerry/32/9096_2.png) [@Ian\_Kerry](https://community.make.com/u/Ian_Kerry)\
**Post date:** [February 23, 2024, 2:52am UTC](https://community.make.com/t/create-new-contact-if-not-found-in-xero/27979/5 "2024-02-23T02:52:34Z")

</div>

Hi Sam

Nearly all my triggers are sql related.  
Also the Xero Modules work differently to the Notion ones.

So there isn’t an error route for the Search for Contact in Xero or the Get contact in Xero.

So I am at a loss as to what to do.

Does anyone have any experience of what i can do in XERO? It is very simple i think.

If when a scenario searches for a contact and it doesn’t find one, then it creates a new one.

Thank you.  
Ian

---

<div class="post-metadata">

**Author:** ![Ian\_Kerry](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/ian_kerry/32/9096_2.png) [@Ian\_Kerry](https://community.make.com/u/Ian_Kerry)\
**Post date:** [February 23, 2024, 4:23am UTC](https://community.make.com/t/create-new-contact-if-not-found-in-xero/27979/6 "2024-02-23T04:23:43Z")

</div>

Just in case anyone follows this thread at a later date, I found the answer.

After the trigger happens, i do a Search Xero module. Which comes up empty if the contact doesnt exist. But then I add a router with two paths. 1 filters where the condition is:

Basic Operators: Exists

If this condition isn’t met, then the other path is taken, where it creates a new Contact.

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/7/3/730036f8679183572fc6bbba02bb8d33d417c9cf.jpeg)

Thanks  
Ian

---

<div class="post-metadata">

**Author:** ![Michaela-Inactive](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/michaela-inactive/32/29_2.png) [@Michaela-Inactive](https://community.make.com/u/Michaela-Inactive)\
**Post date:** [February 23, 2024, 10:24am UTC](https://community.make.com/t/create-new-contact-if-not-found-in-xero/27979/7 "2024-02-23T10:24:45Z")

</div>

Hi @Ian_Kerry

I just want to quickly say congrats on getting this up and running 👏

Thanks a lot for stepping back in here and sharing your final solution for the benefit of the community. This is much, much appreciated 🙏

---

<div class="post-metadata">

**Author:** ![Make\_Bot](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/make_bot/32/14661_2.png) [@Make\_Bot](https://community.make.com/u/Make_Bot)\
**Post date:** [March 8, 2024, 4:47am UTC](https://community.make.com/t/create-new-contact-if-not-found-in-xero/27979/8 "2024-03-08T04:47:41Z")

</div>


