Hi @zerog, hope you are well?
I tried creating a few custom fields on my end and it appears this can easily be achieved through the Function Item node. Here’s what I did:
- First, I opened the JSON version of my Trello board by simply appending .json to its URL
- In there you’ll find an array under the key
customFieldsholding all your custom fields and looking like this:
"customFields": [{
"id": "61767b5b71d35f8b909bcdfe",
"idModel": "61767a546692fd5aa6400f31",
"modelType": "board",
"fieldGroup": "be729f02aed55812ba7e5ec9c7ce36bab0ea96807780957a998f4d7fb1560f7b",
"display": {
"cardFront": true
},
"name": "My Text",
"pos": 81920,
"type": "text",
"isSuggestedField": false
}, ... ]
- Copy the
idvalue from the required custom field - Now, in n8n, you can add a Function Item node after your Trello node getting the respective card. You can then write the content of your custom field in a named field of your n8n item by running code like below in the Function Item node (replace my id with the correct id from in step 2). This uses JavaScript’s find() method to find the custom field with the given ID regardless of the array order.
item.myText = item.customFieldItems.find(field => field.idCustomField == '61767b5b71d35f8b909bcdfe').value;
return item;
- Now your items will contain the value of the respective custom field in their own myText field, regardless of the order of custom items.
My example workflow for this looked like so:
Hope this makes sense and helps!