# Incorrect relation matching when using custom ID field

**URL:** https://community.fibery.io/t/incorrect-relation-matching-when-using-custom-id-field/10775
**Category:** API & Programming
**Created:** [April 27, 2026, 11:56am UTC](https://community.fibery.io/t/incorrect-relation-matching-when-using-custom-id-field/10775 "2026-04-27T11:56:08Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![teibrich](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/teibrich/32/14340_2.png) [@teibrich](https://community.fibery.io/u/teibrich)
#### Post date: [April 27, 2026, 11:56am UTC](https://community.fibery.io/t/incorrect-relation-matching-when-using-custom-id-field/10775/1 "2026-04-27T11:56:08Z")

</div>

Hi there,

I’m experiencing an issue with the Fibery Integration API where entities are being linked incorrectly despite sending correct data. Not sure if this is an API issue or if I just didn’t quite understand how the intended usage is.

**Setup:**

- We’re syncing data from an external system (Jira Assets) to Fibery
- Using the `/api/v1/synchronizer/data` endpoint with `synchronizationType: 'full'`
- Entities have a custom `id` field (using keys like “ES-123”, “ES-456”) instead of UUIDs
- Relations are configured with `targetFieldId: 'id'` to match against this custom field

**The Problem:**  
When syncing a “Measure” entity (let’s call it “M-1312”) that should only be linked to one “School” entity (“S-49”), Fibery is incorrectly linking it to multiple schools (both “S-4” and “S-49”).

**What we’re sending:**

```json
{
  "id": "M-1312",
  "name": "Measure 1312",
  "schulen": ["S-49"]
}

```

**Target entities in Fibery:**

```json
// School S-4
{
  "id": "S-4",
  "name": "School 4"
}

// School S-49  
{
  "id": "S-49",
  "name": "School 49"
}

```

**Expected behavior:**  
M-1312 should only be linked to S-49 (since `schulen` only contains `["S-49"]` and the relation uses `targetFieldId: 'id'` for exact matching).

**Actual behavior:**  
M-1312 is linked to BOTH S-4 and S-49.

**Schema configuration:**

```json
"schulen": {
  "type": "array[text]",
  "relation": {
    "cardinality": "many-to-many",
    "targetType": "school",
    "targetFieldId": "id"
  }
}

```

**Questions:**

1. Does Fibery perform any fuzzy matching on the `id` field (e.g., prefix matching)?
2. Should the `id` field be of a specific format?
3. Is there a known issue with using non-UUID values in the `id` field for relation matching?

Any insights would be appreciated!

Alex

---

<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: [April 27, 2026, 1:17pm UTC](https://community.fibery.io/t/incorrect-relation-matching-when-using-custom-id-field/10775/2 "2026-04-27T13:17:52Z")

</div>

Fibery uses `contains` for matching, so indeed, if you are matching on ‘S-49’ then both ‘S-49’ and ‘S-4’ will be linked.  
I’d suggest doing some kind of hashing or string wrapping of the values prior to matching, so that you can avoid this.

---

<div class="post-metadata">

### Author: ![teibrich](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/teibrich/32/14340_2.png) [@teibrich](https://community.fibery.io/u/teibrich)
#### Post date: [April 27, 2026, 1:40pm UTC](https://community.fibery.io/t/incorrect-relation-matching-when-using-custom-id-field/10775/3 "2026-04-27T13:40:42Z")

</div>

Thanks a lot for your quick reply! I will create a UUID and use that.

From an implementation perspective it really does not matter, but I don’t find it obvious that you use `contains` to match two IDs. If you have the option, perhaps add a note to your documentation 😉

Alex
