Hi !
I am trying to create or update data from Notion to Airtable.
But I have this error :
ERROR: Invalid input for ‘Espaces Coachs (Formaté)’ [item 0]
‘Espaces Coachs (Formaté)’ expects a array but we got ‘AAAA BBBB, CCCC DDDD’.
In the Code node I am trying to change string into array :
const coachArray = $json.property_espaces_coachs_format_string.split(',').map(coach => coach.trim());
const collabArray = $json.property_coach_s_format_string.split(',').map(coach => coach.trim());
const opportArray = $json.property_opportunit_s_format_string.split(',').map(opport => opport.trim());
// Prepare the data
$input.item.json.coachArray = coachArray;
$input.item.json.collabArray = collabArray;
$input.item.json.opportArray = opportArray;
return $input.item;
This is the input for the create or update node :
[
{
“id”: “xxxxxxxx-xxxx8-4288-b293-xxxx”,
“name”: “Xxx Xxx”,
“url”: “https://www.notion.so/Xxx Xxx-5dexx0300586xxxxb29xxxxx4af55446”,
“property_objectifs”: “2023 : \n- Spot coaching ponctuels \n- Coaching fondateurs\n”,
“property_email_rh”: “[email protected]”,
“property_created_time”: “2023-05-04T16:33:00.000Z”,
“property_taille”: “Scale-up”,
“property_coach_s_format_string”: “Xxx Xxx 2”,
“property_espaces_coachs”: [
“xxxxxxx-378a-xx-85c2-bxxxxx464af”,
“xxxxxxxx-8057-40xxx-b8fb-8axxxxc3944a”
],
“property_contacts”: [],
“property_ca_ht_potentiel_2023”: 600,
“property_opportunit_s_format_string”: “Xxx Xxx 1, Xxx Xxx 2, Xxx Xxx 3”,
“property_espaces_coachs_format_string”: “AAAA BBBB, CCCC DDDD”,
“property_notes_business”: [],
“property_statut”: “Client”,
“property_opportunit_s”: [
“febd81cf-dexxx-45c1-b899-fxxxxx2e136”,
“ad97d84a-ce3c-xxx-b1ec-5xxxx65bfbe91”,
“77xxxx4-71fa-4f82xxx0-xxxxxx”
],
“property_secteur”: “Tech”,
“property_coach_s”: [
“a75xxxx39-c507-4xxxxa-9856-5afxxx8xxx20”
],
“property_objectif_offre_annuelle”: [
“Track Manager”
],
“property_nom”: “Xxx Xxx”,
“coachArray”: [
“AAAA BBBB”,
" CCCC DDDD"
],
“collabArray”: [
“Xxx Xxx 2”
],
“opportArray”: [
“Xxx Xxx 1”,
" Xxx Xxx 2",
" Xxx Xxx 3"
]
}
]
Here is the workflow (I don’t know why there is a “?” on the airtable node when I copy past it here) :
Thank you very much for your help !
@Jon
Information on your n8n setup
- n8n version:1.1.1
- Running n8n via n8n cloud: