Skip to main content

Hi there.
Can you help us solve this issue?

After generating the GoogleDrive URL in GAS, we update certain fields in airtable API.
The field type is “URL”.
The code is below. I have already confirmed that the API URL, PAT, GoogleDrive URL and field name I am calling are correct.

const drive_url = "https://drive.google.com/drive/folders/" + folder.getId();

const url = "https://api.airtable.com/v0/XXX(appID)/XXX(TableName)/XXX(recordId)"
const options = {
'method': 'PATCH',
'headers': {
'Authorization': 'Bearer ' + "XXX",
'Content-Type': 'application/json',
},
'payload': JSON.stringify({
'fields': {
'Field1': drive_url,
}
})
};
const response = UrlFetchApp.fetch(url, options);

Then the following error is returned. {“type”: “INVALID_VALUE_FOR_COLUMN”, “message”: “Field \”Field1\“ cannot accept a value because the field is computed”}}

However, the field type of Field1 is "URL", as mentioned above. It is not a calculated field.
Why does this error occur?
I am having trouble solving this problem.

Thanks in advance for your help.

Hm, as a data point, I just did an API call to update a URL field via Postman and it worked fine.  Here's the Postman script:

 

const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", "Bearer rYOUR_API_KEY]");

const raw = JSON.stringify({
"fields": {
"URL": "New URL"
}
});

const requestOptions = {
method: "PATCH",
headers: myHeaders,
body: raw,
redirect: "follow"
};

fetch("https://api.airtable.com/v0/APPID/TABLEID/RECORDID", requestOptions)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.error(error));

 

 


Hm, as a data point, I just did an API call to update a URL field via Postman and it worked fine.  Here's the Postman script:

 

const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", "Bearer rYOUR_API_KEY]");

const raw = JSON.stringify({
"fields": {
"URL": "New URL"
}
});

const requestOptions = {
method: "PATCH",
headers: myHeaders,
body: raw,
redirect: "follow"
};

fetch("https://api.airtable.com/v0/APPID/TABLEID/RECORDID", requestOptions)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.error(error));

 

 


Thank you for your answer.
I tried with Postman and got the same error.


Thank you for your answer.
I tried with Postman and got the same error.


Try creating another URL field and seeing whether that can be updated?  Might want to open a ticket!


Try creating another URL field and seeing whether that can be updated?  Might want to open a ticket!


When another URL field was created and run on the same table, it resulted in UNKNOWN_FIELD_NAME. There is no problem with the name and permissions.

Where can I open a ticket?


When another URL field was created and run on the same table, it resulted in UNKNOWN_FIELD_NAME. There is no problem with the name and permissions.

Where can I open a ticket?


Check out the docs here: https://support.airtable.com/docs/contacting-airtable-support?contact_support=true


Reply