Hello,
I’m developing an Airtable App and I want to access to linked records of a given record.
When looking into the API doc the only way documented is using useRecords like following:
const linkedTable = base.getTableByName("table1");
const linkedRecords = useRecords(
record.selectLinkedRecordsFromCell("table1", {
// Keep the linked records sorted by their primary field.
sorts: [{ field: linkedTable.primaryField, direction: "asc" }],
})
);
the issue is that I’m trying to do some logic in a non React coponent in a “Service” class, so I can’t use useRecords…
In the API docs they are talking about loading data, I tried loading data manually like so:
const table1QueryResult = await table1.selectRecords();
await table1QueryResult.loadDataAsync();
recordToMatch.selectLinkedRecordsFromCell("table1")
but I always get an error:
Error: LinkedRecordsQueryResult data is not loaded at LinkedRecordsQueryResult.get
Thank you,