Hi,
I am trying to get the total count in a SET block to give me the total of rows of an Airtable List per category, I tried this:
Hey @tamone !
Welcome to the community
I have build a small workflow that might help you with your use case. Please note that the Google Sheet node doesn’t have the functionality to add data to a specific cell. Your column should have a name which allows the node to map the information to the correct cell.
Here’s the sample workflow:
You can copy and paste the workflow in the Editor UI. Make sure to configure the credentials and update the spreadsheet ID.
But not working:
I use this table: https://airtable.com/shrsbGWvmsaUyeREs/tblSZInsMMwhr8G43
Where unique identifier is “name”. Thank you very much.
Something like below should do it. I used the Filter by formula parameter to filter the records by a particular category and then used a function node to return just the length. There might be other ways to achieve this, but I have barely any experience with Airtable.
{
"nodes": [
{
"parameters": {},
"name": "Start",
"type": "n8n-nodes-base.start",
"typeVersion": 1,
"position": [
250,
300
]
},
{
"parameters": {
"operation": "list",
"application": "appKUpd1rLmDvMCeZ",
"table": "Movies",
"additionalOptions": {
"filterByFormula": "IF(Category = \"Horror\", TRUE(), FALSE())\n\n"
}
},
"name": "Airtable",
"type": "n8n-nodes-base.airtable",
"typeVersion": 1,
"position": [
570,
300
],
"credentials": {
"airtableApi": "[email protected] "
}
},
{
"parameters": {
"functionCode": "return [{ json: { count: items.length } }]"
},
"name": "Function",
"type": "n8n-nodes-base.function",
"typeVersion": 1,
"position": [
820,
300
]
}
],
"connections": {
"Start": {
"main": [
[
{
"node": "Airtable",
"type": "main",
"index": 0
}
]
]
},
"Airtable": {
"main": [
[
{
"node": "Function",
"type": "main",
"index": 0
}
]
]
}
}
}
RicardoE105:
Hi @RicardoE105 , thank you very much, I forgot to add the “count” in my condition .
2 Likes