I can't find how to merge one data (an ID) to another nodes with matching by one or two fields

problem/question

I can’t figure it out how to merge datas matching key / values like a levenshtein function. Without complexe things.

description

I have differents sources datas for my “Object 1”.

Object contains => url, username, fullName, biography, etc. For the input 1.

And in the input 2 the Object contains => rsLink (match normaly with url), Name, and ID.

My goal is to match by url / rsLink my object to give him the correct ID frome the input 2. Because the id in the input 1 is not correct.

Input 1 => code output a JSON like this :

[
  {
    "fullName": "Person 1",
    "followsCount": 239,
    "url": "https://www.instagram.com/user1",
    "profilePicUrl": "https://example.com/profile1.jpg",
    "profilePicUrlHD": "https://example.com/profile1_hd.jpg",
    "username": "user1",
    "biography": "Biography 1",
    "verified": true,
    "businessCategoryName": "Category 1",
    "followersCount": 282988
  },
  {
    "fullName": "Person 2",
    "followsCount": 42,
    "url": "https://www.instagram.com/user2",
    "profilePicUrl": "https://example.com/profile2.jpg",
    "profilePicUrlHD": "https://example.com/profile2_hd.jpg",
    "username": "user2",
    "biography": "Biography 2",
    "verified": true,
    "businessCategoryName": "Category 2",
    "followersCount": 252330
  },
  {
    "fullName": "Person 3",
    "followsCount": 1183,
    "url": "https://www.instagram.com/user3",
    "profilePicUrl": "https://example.com/profile3.jpg",
    "profilePicUrlHD": "https://example.com/profile3_hd.jpg",
    "username": "user3",
    "biography": "Biography 3",
    "verified": false,
    "businessCategoryName": "Category 3",
    "followersCount": 34919
  },
  {
    "fullName": "Person 4",
    "followsCount": 295,
    "url": "https://www.instagram.com/user4",
    "profilePicUrl": "https://example.com/profile4.jpg",
    "profilePicUrlHD": "https://example.com/profile4_hd.jpg",
    "username": "user4",
    "biography": "Biography 4",
    "verified": true,
    "businessCategoryName": "Category 4",
    "followersCount": 792199
  }
]

Input 2 => code output a JSON like this :

[
  {
    "id": "random_id_1",
    "fullName": "Lorem Ipsum",
    "followsCount": 239,
    "url": "https://www.instagram.com/loremipsum1",
    "profilePicUrl": "https://example.com/profile1.jpg",
    "profilePicUrlHD": "https://example.com/profile1_hd.jpg",
    "username": "loremipsum1",
    "biography": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
    "verified": true,
    "businessCategoryName": "Category Lorem",
    "followersCount": 282988
  },
  {
    "id": "random_id_2",
    "fullName": "Lorem Ipsum",
    "followsCount": 42,
    "url": "https://www.instagram.com/loremipsum2",
    "profilePicUrl": "https://example.com/profile2.jpg",
    "profilePicUrlHD": "https://example.com/profile2_hd.jpg",
    "username": "loremipsum2",
    "biography": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
    "verified": true,
    "businessCategoryName": "Category Ipsum",
    "followersCount": 252330
  },
  {
    "id": "random_id_3",
    "fullName": "Lorem Ipsum",
    "followsCount": 1183,
    "url": "https://www.instagram.com/loremipsum3",
    "profilePicUrl": "https://example.com/profile3.jpg",
    "profilePicUrlHD": "https://example.com/profile3_hd.jpg",
    "username": "loremipsum3",
    "biography": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
    "verified": false,
    "businessCategoryName": "Category Dolor",
    "followersCount": 34919
  },
  {
    "id": "random_id_4",
    "fullName": "Lorem Ipsum",
    "followsCount": 295,
    "url": "https://www.instagram.com/loremipsum4",
    "profilePicUrl": "https://example.com/profile4.jpg",
    "profilePicUrlHD": "https://example.com/profile4_hd.jpg",
    "username": "loremipsum4",
    "biography": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
    "verified": true,
    "businessCategoryName": "Category Sit",
    "followersCount": 792199
  }
]

If anyone have an idea it will be great.

i search to this because i tryed to update Airtable informations but without the matching i cant update the correct ids datas.

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

hello @Pierre_R1

That one should do the job

I already try do this dont solve my problem. ANd it will not be iterable for multiples items.
I need to match urls (or urls and names) to find the id and give the id to my object for every items in the different inputs.


It’s work but just one execution even if i get multiple items so thats works 50% :sweat_smile:

it should work fine, just change the output type:

Thanks… but thats not the solution.

You set “keep non matches” or i want only matches.

If i set only Keep Matches i get one result who’s really grate and correct.

I want that for all items.

Then I don’t get that part. Can you provide an example of what are you receiving (like in the first comment, but there are no matching urls in the example) and what should be in the end?

I juste want to merge every items in my sets to merge id from setB to setA if the url match.
Sorry i can’t give you more details that will not help you.
And i think i’m gonna go edit some extra code to do the matching betweens my set.

1 Like

I finally did it with AWS Lambda code thats taking my set of data 1 and combine with levenshtein algorithm with the url match and place the id thats match between set1 and set2.

If someone interested by the solution please tell me i’ll create a n8n workflow thats do that for public test.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.