I would like to merge 2 items
I’m not a dev so sorry about asking this.
I tried reading and found a code to merge 2 arrays but not as i want to get in result.
I have a fixed url (a domain)
but a different landing pages (variable)
So I:
set my value call “myurl” (for my static domain value)
and get from my previous node the “values” (for my variable pages)
for my approach i have add this both value in a node called Set_url
the code use in the function node based on my reseach
var json1 = `{{$node["Set_url"].json["myurl"]}}`;
var json2 = `{{$node["Set_url"].json["values"]}}`;
jsonmycompleteurl = json1.concat(json2);
Describe the issue/error/question
I thought the code below could work with my simple concatenation item1+item2
but i have this error ERROR: Cannot read properties of undefined (reading ‘every’) [Line 772]
1 it’s a basic url (“https://domain/dynamicpage”)
2 i split the url according to the “/” sign
3 I extract with the if only “values” containing numbers because my dynamic pages always have numbers while my domain does not.
4 it’s the set that regroup the two values in the node called Set_url
Thank you for your help on this
Information on your n8n setup
n8n version: 0.182.0
Database you’re using (default: SQLite):
Running n8n with the execution process [own(default), main]:own(default)
Running n8n via [Docker, npm, n8n.cloud, desktop app]:desktop app
Not completely sure what you are trying to do.
You are looking for a merge node if you want to actually merge different items together.
But I suspect you don’t really need this. You seem to simply want to add 2 string together that exist in the same item. (or can be added because one is static)
Can you share an example of the workflow with some mock data, this makes it a lot easier for us to help you.
Yes it’s true for " I suspect you don’t really need this. You seem to simply want to add 2 string together that exist in the same item. (or can be added because one is static)"
sure i can share a sample I have updated the workflow chapter in the question with it.
@BramKn
It works when i’m copy/paste your flow.
If I understand you have merge/combined in the node set_url1 the values of both items.
with the code below
{{$node["Set Example Data1"].json["sun"]}}{{ $json["values"] }}