Help

Save the date! Join us on October 16 for our Product Ops launch event. Register here.

Re: URL fields returned "INVALID_VALUE_FOR_COLUMN” error

329 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Ni0323
4 - Data Explorer
4 - Data Explorer

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.

5 Replies 5
TheTimeSavingCo
18 - Pluto
18 - Pluto

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:

Screenshot 2024-10-09 at 5.29.05 PM.png

 

const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", "Bearer [YOUR_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.

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?