# Merging entities of the same type

**URL:** <https://community.fibery.io/t/merging-entities-of-the-same-type/1970>\
**Category:** Ideas & Features\
**Created:** [September 2, 2021, 7:37am UTC](https://community.fibery.io/t/merging-entities-of-the-same-type/1970 "2021-09-02T07:37:24Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![karthikk\_vijay](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/karthikk_vijay/32/1220_2.png) [@karthikk\_vijay](https://community.fibery.io/u/karthikk_vijay)\
**Post date:** [September 2, 2021, 7:37am UTC](https://community.fibery.io/t/merging-entities-of-the-same-type/1970/1 "2021-09-02T07:37:24Z")

</div>

Hey all, I searched through but couldn’t find anything relevant.

Is there a way to merge two entities together (of the same type) so that their fields and relations all smoothly add up without conflict?

---

<div class="post-metadata">

**Author:** ![Polina\_Zenevich](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/polina_zenevich/32/480_2.png) [@Polina\_Zenevich](https://community.fibery.io/u/Polina_Zenevich)\
**Post date:** [September 6, 2021, 3:30pm UTC](https://community.fibery.io/t/merging-entities-of-the-same-type/1970/2 "2021-09-06T15:30:37Z")

</div>

Hi!  
I’m afraid, no nice way to do that. But really curious to know about the use case you have 🤗

---

<div class="post-metadata">

**Author:** ![Oshyan](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/oshyan/32/11431_2.png) [@Oshyan](https://community.fibery.io/u/Oshyan)\
**Post date:** [September 6, 2021, 5:26pm UTC](https://community.fibery.io/t/merging-entities-of-the-same-type/1970/3 "2021-09-06T17:26:14Z")

</div>

I don’t know if this is similar enough, but my needs related to this are around imported/synced data:

> [@Merging synced data to existing types and avoiding "type proliferation"?](https://community.fibery.io/t/merging-synced-data-to-existing-types-and-avoiding-type-proliferation/1946):
>
> Not sure if this belongs in #ideas-features or not, but probably, given how it turned out after I wrote it. grinning_face_with_smiling_eyes So, it’s clear that one of Fibery’s greatest strengths is in its ability to replace multiple systems, bring data from various places into one location and interconnect it, etc. But the more I do that (now with Discourse and Airtable connected, and plans to add more), the more “type proliferation” I have. And the thing that is most challenging with this is…

That thread refers specifically to integrations, but imported data from e.g. CSV would likely often suffer from similar issues.

---

<div class="post-metadata">

**Author:** ![Polina\_Zenevich](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/polina_zenevich/32/480_2.png) [@Polina\_Zenevich](https://community.fibery.io/u/Polina_Zenevich)\
**Post date:** [September 7, 2021, 9:43am UTC](https://community.fibery.io/t/merging-entities-of-the-same-type/1970/4 "2021-09-07T09:43:49Z")

</div>

Well, I think CSV import improvement and specific action like “Convert”, but “Merge” will be two different solutions for two different cases (both of them are important for sure!)

Thanks for the link, will note it too 💪

---

<div class="post-metadata">

**Author:** ![Oshyan](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/oshyan/32/11431_2.png) [@Oshyan](https://community.fibery.io/u/Oshyan)\
**Post date:** [February 18, 2022, 1:52am UTC](https://community.fibery.io/t/merging-entities-of-the-same-type/1970/5 "2022-02-18T01:52:31Z")

</div>

This now seems more like a feature request to me, and something I have a growing need for, as I referenced above.

---

<div class="post-metadata">

**Author:** ![Chris\_Shaw](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chris_shaw/32/5580_2.png) [@Chris\_Shaw](https://community.fibery.io/u/Chris_Shaw)\
**Post date:** [October 25, 2022, 3:03am UTC](https://community.fibery.io/t/merging-entities-of-the-same-type/1970/6 "2022-10-25T03:03:50Z")

</div>

I ran into this issue today. I’ve been a dumb human and created two records that, at the end of the day, are really the same thing. I want to make them the same thing. The problem is I can’t just delete one without moving over some of the fields and content, because they each have their own special flavor of filled-in fields.

I can copy and paste in a table view, but I have to go field by field and be careful not to overwrite data. Then I’ll have to manually merge a few columns where both records have partial data.

---

<div class="post-metadata">

**Author:** ![YvetteLans](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/yvettelans/32/6101_2.png) [@YvetteLans](https://community.fibery.io/u/YvetteLans)\
**Post date:** [December 5, 2022, 2:55pm UTC](https://community.fibery.io/t/merging-entities-of-the-same-type/1970/7 "2022-12-05T14:55:42Z")

</div>

I have a (very common?) use case 🙂 I have an agency and I’m setting up Fibery as a CRM for my clients. The contact records will be filled manually and via other systems/integrations.

- Manually: you get in touch via LinkedIn/Instagram DM and add a lead to the contact database. You don’t have an email address yet but you do fill in all kind of other fields (notes, lead status, lead channel etc.).
- Via integrations: when a Calendly (sales) call is booked, then we update or create the contact record. We do the same when an order comes in (and with a few other scenarios).

The problem is that:

- You often _don’t have an email address_ in a early stage (for example when you have contact with a lead via DM)
- You _always_ have an email address when a Calendly call or order comes it
- But people use different email addresses
- And we have several situations (in Holland) where people have the same first name and last name (but aren’t the same person)

So currently we check based on email address if a contact exists. We found a way with @Chr1sG to make a ‘possible duplicates’ view in the contact database.

- Contacts with the same First name + Last name
- But with a different email address

First we thought ‘merging’ was not needed. We just add a ‘second email address’ and delete the newest record.

But I just found out with a real life example that we still need it.

- Record A: (manually added) Firstname, Lastname, Leadstatus field, Notes, etc.
- Record B: (system added) Firstname, Lastname, Email address, Order (linked product + price), Project (automatically created when a new order comes in)

So now we want to keep record A since it is the original one. But record B contains a lot more than only an extra email address. Without a merging option our clients needs to do a lot to link the order and project to the right contact.

Possible solution (hopefully)  
@Chr1sG can we make an automation button that we can press manually to merge two contacts? That would be a great solution without an official ‘merge option’.

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [December 5, 2022, 3:59pm UTC](https://community.fibery.io/t/merging-entities-of-the-same-type/1970/8 "2022-12-05T15:59:56Z")

</div>

Hi @YvetteLans,  
I’m sure we can figure something out, and hopefully other Fibery users will benefit from what we implement 🙂  
Just want to check something: in your example, the two entities represent the same person, but they have differing pieces of information. In some cases, one entity is empty (which makes it obvious what to keep) but what should happen if the two entities contain information that contradicts:

| | Firstname | Lastname | Leadstatus field | Notes | Email address | Order | Project |
| --- | --- | --- | --- | --- | --- | --- | --- |
| A | John | Smith | Open | Is a solopreneur | | | |
| B | Jane | Smith | | | [j.smith@gmail.com](mailto:j.smith@gmail.com) | #1234 | OPD |
| Result | ? | Smith | Open | Is a solopreneur | [j.smith@gmail.com](mailto:j.smith@gmail.com) | #1234 | OPD |

---

<div class="post-metadata">

**Author:** ![YvetteLans](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/yvettelans/32/6101_2.png) [@YvetteLans](https://community.fibery.io/u/YvetteLans)\
**Post date:** [December 5, 2022, 8:34pm UTC](https://community.fibery.io/t/merging-entities-of-the-same-type/1970/9 "2022-12-05T20:34:16Z")

</div>

Hi @Chr1sG,  
Thanks for the quick reply! For my own clients I think the chances are likely that they **do** need to take some action manually:

1. First they need to make sure that it is indeed the same person. They can check that based on a lot of variables.

- When they think record A and B is the same person (because John decided he wants to be a woman per now on 🙂); then they will continu to step 2.
- When they think John and Jane are seperate persons, then it would be helpful if they can check an ‘ignore’ checkbox or so (and then we can decide to not show the entities with ‘ignore’ in the ‘Possible duplicates’ view)

1. Then they need to decide which record they want to keep. I think in every situation I can think of, that that should be the oldest record (so let’s asume that’s A in your example).
2. Then you want to add the information of record B into A and delete record B.

What I would suggest is that only if a field is filled, the data can be overwritten.

So when we merge information of record B in record A in your example, then the lead status will still be open (we won’t overwrite it since the field is empty in record B)

There are two situations that the user should be aware of (we will make a help guide for this)

1. If record A contains [j.smith@gmail.com](mailto:j.smith@gmail.com) and record B contains **[j.smith@hotmail.com](mailto:j.smith@hotmail.com)** (so different email address), we want the email address of record B to be placed in the ‘secondary email address field’ or record A (either manually or we can let the system do that if that’s not to complex).
2. If record A contains a postal address (13th Street, New York) and record B also contains an address (let’s say 7835 Ridgeview Av, Brooklyn) then after the ‘merge’ the address of record A will be overwritten by the address of record B.

That should not be a problem. Because we normally only get the postal address when a new order comes in. And when a new order comes in we can assume that that postal address is indeed the most recent postal address.

And finally: the above is only applicable for fields (since we can only have one value in a field). The orders and project are entities in seperate database. So there we can _add_ entities instead of overwrite them.

I think this will cover all real life situations in CRM scenario 🙂

TLDR;

- User decides which record should remain after merge
- User accepts that after the merge the information in some information can be overwritten
- User will be very happy if we can somehow don’t overwrite the email address while merging but add the email address in the secondary email address field. Because most clients will have multiple email addresses (but not multiple postal addresses)
- But user will not cry if he/she needs to add that email address manually in a field if that’s not possible 🙃

Edit: pro tip for if somebody wants to build the same solution… If system finds out that we have a possible duplication, we will set a checkbox so that the contacts can show up in a view.

We will also create a task in user’s daily task list with something like “We currently noticed that there maybe is a duplicate contact within your contact database. Please check the ‘Possible duplication’ list and follow the instructions.”

Just to make it extra dummy proof 😃l

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [December 6, 2022, 11:19am UTC](https://community.fibery.io/t/merging-entities-of-the-same-type/1970/10 "2022-12-06T11:19:00Z")

</div>

[Here’s a template](https://shared.fibery.io/t/d57d10a4-c8e5-4604-9936-cbffaf82d88d-manual-merge) for merging contacts. It has a button, which allows the user to choose which ‘destination’ Contact an entity should be merged to.  
It has a couple of formulas that determine how the various fields should be updated:

- the email (primary) in the destination is kept, and if an email exists in the ‘source’ it gets written to the secondary email field
- the state is updated with the value in the source
- notes in rich text field are appended
- orders in the source are added to the existing orders in the destination

These rules may not be exactly what you need, but hopefully give you an idea of the possibilities.

![firefox_BGioBlbJz3](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/f/f27fef0718bffad90eca0c0db6d59643b1fb8bc8.gif)

---

<div class="post-metadata">

**Author:** ![YvetteLans](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/yvettelans/32/6101_2.png) [@YvetteLans](https://community.fibery.io/u/YvetteLans)\
**Post date:** [December 6, 2022, 3:12pm UTC](https://community.fibery.io/t/merging-entities-of-the-same-type/1970/11 "2022-12-06T15:12:59Z")

</div>

Thank you so much! Looks awesome! Will need to dig a bit deeper into all the formulas.

Only problem I have right now:

- We only want to merge if it’s the same person
- When it’s the same person, we have exactly the same name
- In my test I’ve choosen the wrong entity while merging (you can’t decided where to merge to because both contacts with exactly the same name are shown)

 ![image](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/b/bb1b193fbc1877cbab9685e2da4161308742d152.png)

Is there maybe a way that we have more information about the contact so we can decide where to merge to? Maybe/hopefully we can show the creation date of the entity somehow in the dropdown? 😅

Thanks again!

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [December 6, 2022, 3:46pm UTC](https://community.fibery.io/t/merging-entities-of-the-same-type/1970/12 "2022-12-06T15:46:07Z")

</div>

Yeah, I realised that after I published the template 🤦‍♂️

It’s actually a weird side-effect of the fact that an automation can theoretically run on a batch of entities  
(but this shouldn’t happen in this specific case - in fact you mustn’t try and merge multiple entities into one destination at the same time).

Anyway, I’ve two possible suggestions:

- don’t use a button(!) and just link items from a view. You won’t get offered the entity itself:  
 ![firefox_Yebd9ZY91o](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/9/9d4fb9b801c8da59a1abe9f91552f51aecb9856f.gif)

- tweak the name formula so that entities can always be distinguished:  
 ![firefox_RKJTo2E4QO](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/e/e3ff394e69a2c01c55bb5d86fff6ccd7af67e0f8.gif)

---

<div class="post-metadata">

**Author:** ![YvetteLans](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/yvettelans/32/6101_2.png) [@YvetteLans](https://community.fibery.io/u/YvetteLans)\
**Post date:** [December 8, 2022, 5:36pm UTC](https://community.fibery.io/t/merging-entities-of-the-same-type/1970/13 "2022-12-08T17:36:55Z")

</div>

Hi Chris,

Thanks again! Difficult choice 🤪 I’m thinking about both options!

- because I really like the idea to link the contact in the ‘Merge to’ field
- but (due to integrations) I can also imagine we have 3 contacts; then it would be great to see to which contact you want to merge
- and it can be helpful that you visually know that you have indeed two people with the same name in your database when they aren’t the same person

So that would do the trick I guess 😏🥳

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [December 8, 2022, 5:46pm UTC](https://community.fibery.io/t/merging-entities-of-the-same-type/1970/14 "2022-12-08T17:46:15Z")

</div>

Well, here’s another thing you could try: you can use a formula for the Name field that only adds the numerical identifier if there is a duplicate.

As I recall, you’re using an auto self relation to find matching items. You could maybe use something like this:

`Voornaam + " " + Achternaam + If([Niet verwijderen - Check dubbele contacten - 1].Count() > 1," (" + [Public Id] + ")","")`

---

<div class="post-metadata">

**Author:** ![Yuri\_BC](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/yuri_bc/32/8803_2.png) [@Yuri\_BC](https://community.fibery.io/u/Yuri_BC)\
**Post date:** [July 26, 2023, 1:56pm UTC](https://community.fibery.io/t/merging-entities-of-the-same-type/1970/15 "2023-07-26T13:56:52Z")

</div>

A feature to merging entities (not requiring automations) would be useful for end users, and my team does doing merging manually on a daily basis because of the following use case:

I have ‘hub’ entities which function like index notes in a shared zettelkasten, and they create collections of pages that often have the same function as a book with chapters, or a growing evergreen report, or a collection of meeting notes.

Current workaround: feed view

1. Manually create a feed view of the pages filtered by the hub relation.
2. Use chrome rightclick to print as pdf.

Because this requires a lot of manual configuration of the feed view filter for a specific relation, we often end up copy pasting content into a new entity. Both solutions are not ideal.

---

<div class="post-metadata">

**Author:** ![TAK](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/tak/32/6113_2.png) [@TAK](https://community.fibery.io/u/TAK)\
**Post date:** [January 30, 2024, 1:03pm UTC](https://community.fibery.io/t/merging-entities-of-the-same-type/1970/16 "2024-01-30T13:03:58Z")

</div>

Hi,

This is really interesting. I am trying to do something like this and struggling. Any chance that template could be reshared?
