Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support linked record fields #6

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

clizzin
Copy link

@clizzin clizzin commented Jul 17, 2017

If a table has a Linked Record field, the Airtable API response contains
record IDs that look something like "rec1234567890123" instead of
something intelligible. What we probably want instead is the value of
the linked record's (or linked records') primary field. This commit
adds support for fetching those values.

The way this is written, the user must add some configuration in
settings.json for each linked record field: the name of the field, the
table to which it links, and the name of that table's primary field.
Ideally, all of this could be inferred automatically, and it is indeed
possible to guess when a field's value consists of record IDs using a
regex, but unfortunately, the Airtable API doesn't offer a way to
discover a linked record field's linked table or the table's primary
field. Hence, the need to ask the user for explicit configuration.

It's possible to add some intelligent defaults, e.g. assume the field,
the table, and the table's primary field are all the same, but as the
exact desired behavior is debatable, I leave it for another time.

It's also worth noting that the performance is not ideal as we execute
N+1 API requests. I also leave that to be solved another day.

If a table has a Linked Record field, the Airtable API response contains
record IDs that look something like "rec1234567890123" instead of
something intelligible.  What we probably want instead is the value of
the linked record's (or linked records') primary field.  This commit
adds support for fetching those values.

The way this is written, the user must add some configuration in
settings.json for each linked record field: the name of the field, the
table to which it links, and the name of that table's primary field.
Ideally, all of this could be inferred automatically, and it is indeed
possible to guess when a field's value consists of record IDs using a
regex, but unfortunately, the Airtable API doesn't offer a way to
discover a linked record field's linked table or the table's primary
field.  Hence, the need to ask the user for explicit configuration.

It's possible to add some intelligent defaults, e.g. assume the field,
the table, and the table's primary field are all the same, but as the
exact desired behavior is debatable, I leave it for another time.

It's also worth noting that the performance is not ideal as we execute
N+1 API requests.  I also leave that to be solved another day.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant