Help

Airtable Cobuilder is here! Learn more about our new no-code app creation feature, powered by AI on the Airtable Academy

Re: How Do I Clear a Records "Linked Field" Value Using Script?

Solved
Jump to Solution
1536 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Mono
4 - Data Explorer
4 - Data Explorer

I am really struggling to do something as simple as "clear" a records linked field value.

I have tried... 

table.updateRecordAsync(r, { "Linked Field": [{id :''}]});
table.updateRecordAsync(r, { "Linked Field": [{id :null}]});
table.updateRecordAsync(r, { "Linked Field": []});

If anyone can let me know how to clear a records linked field that would be amazing.

Thanks

1 Solution

Accepted Solutions
Ben_Young1
11 - Venus
11 - Venus

Hey @Mono

Someone asked a similar question in this thread.
The short answer is that you need to pass an empty array to the linked record field.

It should look like this:

table.updateRecordAsync(recordId, {
    "linked_record_field": []
});

See Solution in Thread

3 Replies 3
Ben_Young1
11 - Venus
11 - Venus

Hey @Mono

Someone asked a similar question in this thread.
The short answer is that you need to pass an empty array to the linked record field.

It should look like this:

table.updateRecordAsync(recordId, {
    "linked_record_field": []
});

Your third version was correct. You probably got tripped up in an issue today when scripting was not working and didn't realize that it was a problem with Airtable and not your script. It wasn't reported on Airtable's status page, but multiple users were experiencing issues with previously working scripts today.

table.updateRecordAsync(r, { "Linked Field": []});

 

Mono
4 - Data Explorer
4 - Data Explorer

Thanks All - Sending through the blank array is indeed the answer.

Looks like the issue with Airtable on Friday was stopping it from working.

Thanks!