Getting INVALID_VALUE_FOR_COLUMN error when modifying relationship field in Airtable

I’m working with two connected tables in Airtable. My main table is called sessions and it has a relationship field named participants that links to records in another table called members. This relationship field stores an array of record IDs from the members table.

When I try to add a new member ID to this relationship field using Spring Boot JPA, I keep getting an error. Here’s the code I’m using:

public Session addParticipant(String sessionId, String memberId) {
    Session currentSession = (Session) this.findSessionById(sessionId).get();
    List<String> participantList = currentSession.getParticipants();
    participantList.add(memberId);
    currentSession.setParticipants(participantList);
    return sessionRepository.save(currentSession);
}

public Session save(Session session) {
    return this.table.save(session);
}

The memberId I’m trying to add definitely exists in the members table, but I still get this error message:

AirtableException: Value is not an array of record IDs. (INVALID_VALUE_FOR_COLUMN) [Http code 422]

What could be causing this issue? How should I properly update linked record fields in Airtable?

Had this exact issue last year integrating our project management system with Airtable. The error’s usually from how you’re formatting the record IDs.

Airtable needs linked record IDs with the “rec” prefix. Your memberId should look like “recXXXXXXXXXXXXXX” - not just a plain string.

Also check if participantList is actually null before adding to it. I’ve seen the relationship field come back as null instead of an empty array, which breaks the add operation.

Try this:

List<String> participantList = currentSession.getParticipants();
if (participantList == null) {
    participantList = new ArrayList<>();
}
participantList.add(memberId);

Verify your memberId format matches what Airtable expects. Log the exact value you’re trying to add and compare it with existing IDs in your relationship field.

This video covers linking tables in Airtable - might help you understand the structure better:

If the format looks right, double check your table permissions and make sure your API key has write access to both tables.