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?