Skip to content
Issue with Airtable...
 
Notifications
Clear all

Issue with Airtable Update

11 Posts
3 Users
0 Reactions
4 Views
StanMeister
(@stanmeister)
Posts: 5
Active Member
Topic starter
 

Hello,

I'm encountering an issue when trying to update a row in Airtable using its row ID.

My current process involves:
1. Listing records to retrieve the ID and all associated data.
2. Checking if the name field matches "LE CORRE-HEURTIN".
3. Modifying the numeroRPPS field to 1.
4. Updating only the numeroRPPS field for that specific record using its row ID.

Here's my workflow:

Unfortunately, the Airtable update node does not seem to be sending the correct data, as the numeroRPPS field remains unchanged. Am I missing something? Is there a more streamlined and accurate method to achieve this?

 
Posted : 09/03/2021 11:37 am
RicardoE105
(@ricardoe105)
Posts: 18
Active Member
 

You need to change items[0].json.fields.numeroRPPS = 1 to items[0].json.numeroRPPS = 1

Also, you might want to replace the function node with a set node. Check the example below:

json
{
"nodes": [
{
"parameters": {},
"name": "Start",
"type": "n8n-nodes-base.start",
"typeVersion": 1,
"position": [
250,
300
]
},
{
"parameters": {
"operation": "list",
"application": "appl8VT0U5WSVMlQN",
"table": "pharmaciens",
"additionalOptions": {}
},
"name": "Airtable",
"type": "n8n-nodes-base.airtable",
"typeVersion": 1,
"position": [
540,
330
],
"credentials": {
"airtableApi": "Airtable Credentials"
}
},
{
"parameters": {
"operation": "update",
"application": "={{$node["Airtable"].parameter["application"]}}",
"table": "={{$node["Airtable"].parameter["table"]}}",
"id": "={{$node["Function"].json["id"]}}",
"updateAllFields": false,
"fields": [
"numeroRPPS"
],
"options": {}
},
"name": "Airtable2",
"type": "n8n-nodes-base.airtable",
"typeVersion": 1,
"position": [
1120,
150
],
"credentials": {
"airtableApi": "Airtable Credentials"
}
},
{
"parameters": {
"conditions": {
"string": [
{
"value1": "={{$node["Airtable"].json["fields"]["nom"]}}",
"value2": "LE CORRE-HEURTIN"
}
]
}
},
"name": "IF",
"type": "n8n-nodes-base.if",
"typeVersion": 1,
"position": [
740,
330
]
},
{
"parameters": {},
"name": "NoOp",
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [
930,
430
]
},
{
"parameters": {
"values": {
"string": [],
"number": [
{
"name": "numeroRPPS",
"value": 1
}
]
},
"options": {}
},
"name": "Set",
"type": "n8n-nodes-base.set",
"typeVersion": 1,
"position": [
920,
220
]
}
],
"connections": {
"Airtable": {
"main": [
[
{
"node": "IF",
"type": "main",
"index": 0
}
]
]
},
"IF": {
"main": [
[
{
"node": "Set",
"type": "main",
"index": 0
}
],
[
{
"node": "NoOp",
"type": "main",
"index": 0
}
]
]
},
"Set": {
"main": [
[
{
"node": "Airtable2",
"type": "main",
"index": 0
}
]
]
}
}
}

 
Posted : 09/03/2021 12:47 pm
StanMeister
(@stanmeister)
Posts: 5
Active Member
Topic starter
 

I attempted to use the Set node, but I'm still unable to update the value.

In the Airtable node, I require the row's ID, which I'm obtaining from the IF node (this is the last node with this information because I'm using "keep only set" in the Set node).

I encountered the following error:

ERROR: Airtable error response [INVALIDVALUEFOR_COLUMN]: Field “numeroRPPS” cannot accept the provided value

Error: Airtable error response [INVALID_VALUE_FOR_COLUMN]: Field "numeroRPPS" cannot accept the provided value
    at Object.apiRequest (/usr/local/lib/node_modules/callin.io/node_modules/callin.io-nodes-base/dist/nodes/Airtable/GenericFunctions.js:35:23)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async Object.execute (/usr/local/lib/node_modules/callin.io/node_modules/callin.io-nodes-base/dist/nodes/Airtable/Airtable.node.js:516:32)
    at async /usr/local/lib/node_modules/callin.io/node_modules/callin.io-core/dist/src/WorkflowExecute.js:395:47

Here's my workflow:

I don't understand this message, as the value format appears to be correct (11 digits).

 
Posted : 09/03/2021 1:28 pm
RicardoE105
(@ricardoe105)
Posts: 18
Active Member
 

Could you share a screenshot of the output from the Set node? Also, what is the data type of the numeroRPPS field in Airtable?

 
Posted : 09/03/2021 1:30 pm
StanMeister
(@stanmeister)
Posts: 5
Active Member
Topic starter
 

Set node result:

Set node result with the “keep only set” option:

The field type in Airtable is “single line text”. This is the default type when adding data via CSV.

 
Posted : 09/03/2021 2:07 pm
RicardoE105
(@ricardoe105)
Posts: 18
Active Member
 

Ah, that clarifies the issue. You have two options: either use a string within the Set node or adjust the field type in Airtable to be a number.

 
Posted : 09/03/2021 2:10 pm
StanMeister
(@stanmeister)
Posts: 5
Active Member
Topic starter
 

Confirmed. No further errors. However, the numeroRPPS field remains unchanged.

pb update3 airtable

I'm questioning whether the process is transmitting the correct data, as this is the output from the update node:

There is no record of the "numeroRPPS" set to "11111111111" as specified in the set node.

 
Posted : 09/03/2021 2:26 pm
RicardoE105
(@ricardoe105)
Posts: 18
Active Member
 

I just checked, and it appears the API call for updating records has been modified. I'm looking into it and will provide updates.

 
Posted : 09/03/2021 2:46 pm
RicardoE105
(@ricardoe105)
Posts: 18
Active Member
 

The issue has been resolved. We will notify you upon its release.

https://github.com/n8n-io/n8n/pull/1532/commits/acb03c494c786df67ca7566e97aaafa6256c8780

 
Posted : 12/03/2021 1:40 am
StanMeister
(@stanmeister)
Posts: 5
Active Member
Topic starter
 

Thank you very much.

:slight_smile:

 
Posted : 12/03/2021 8:41 am
jan
 jan
(@jan)
Posts: 39
Eminent Member
 

Released with callin.io@0.111.0

 
Posted : 12/03/2021 12:04 pm
Share: