Describe the problem/error/question
Posting this here in follow up to: Unable to access content of a previous node from anything other than the immediate next node · Issue #7623 · n8n-io/n8n · GitHub
When processing batch items, the IF node throws the following error:
ERROR: Invalid expression under ‘Conditions > String’
The expression uses data in the node ‘Salesforce’ but there is more than one matching item in that node
Video: https://photos.app.goo.gl/FiwSjYqDdYNKQG439
What is the error message (if any)?
Please share your workflow
Share the output returned by the last node
Please check the video and then use the data below for the last two nodes
Salesforce
query
SELECT Id, Legacy_ID__c FROM Contact
WHERE planet_CRM_Address_Processed__c = false AND Legacy_ID__c != null
LIMIT 2
[
{
"attributes": {
"type": "Contact",
"url": "/services/data/v39.0/sobjects/Contact/0031v00003JcdMAAAZ"
},
"Id": "0031v00003JcdMAAAZ",
"Legacy_ID__c": "169193"
},
{
"attributes": {
"type": "Contact",
"url": "/services/data/v39.0/sobjects/Contact/0031v00003JcdMBAAZ"
},
"Id": "0031v00003JcdMBAAZ",
"Legacy_ID__c": "169195"
}
]
for MySQL node:
query:
SELECT
l.party_id,
l.type,
l.id
FROM locator l
INNER JOIN party p on l.party_id = p.id
WHERE l.category = 'address'
AND l.party_id = '{{ $('Salesforce1').item.json.Legacy_ID__c }}'
AND l.is_default = 1
AND l.real_locator_id IS NULL
AND l.deleted_at IS NULL;
[
{
"party_id": 169193,
"type": "default",
"id": 338058
},
{
"party_id": 169195,
"type": "default",
"id": 890332
}
]
Information on your n8n setup
- n8n version: 1.15.2
- Database (default: SQLite): Postgres
- n8n EXECUTIONS_PROCESS setting (default: own, main): queue
- Running n8n via (Docker, npm, n8n cloud, desktop app): heroku
- Operating system: