-
Notifications
You must be signed in to change notification settings - Fork 4
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
fix the schedule table to play nicely with airtable #157
Comments
The autonumber field looks like the way to go. |
Yes, @colindavey, yesterday I messaged Devin, the person working on the HSDS Airtable template with Open Referral and he replied, the U in UID is unique, for unique identifier:
For context in reading his reply, here's the note I wrote to him on their Slack: Our team entered information into Airtable before being aware of HSDS and we're still learning how to configure tables to HSDS. The first phase has been a schedule table and I configured the primary field as ID. This is a read-only link to our base: https://airtable.com/invite/l?inviteId=invK6Fh0H2po2c4oW&inviteToken=8882388a9b5d965e119f7bd15c379d1a6a517f2783098fbba37ec5a8491601c7 The schedule field links to the Help Services table (all services are listed in one table there), pulling in Name and Hours of Operation to the schedule table so the plain language hours can be read there and inform the enter of schedule data. You'll notice that ID field is currently blank, but I gather that Airtable API automatically assigns a number to the field? I don't really know. @devin, do you have any recommendations for how to configure an ID in our primary field in the schedule table in that base we're using? For instance, would it be a formula? or is it left blank and the Airtable API assigns a number that exists where needed but just isn't visible in the field? |
Airtable generates its oun id's automatically so adding our own is redundant. That will put two id's on the data coming back from the API. Please take a look at the airtable generated API to understand the data structure better. I don't think the folks who created the hsds example airtable realized we get id's for free and the ID is an artifact of making a copy of the schema from mysql where you have to define them. |
What I was trying to say is that we can use the option from Mark's article that uses a formula in the primary field that combines a string (the provider name in our case) with an autonumber field. |
Then you will have two id's. Please look at the airtable API and you will see record.id if you add another you'll have record.fields.id as well. When the airtable API shows linked tables it uses the internal ID. The second ID will be superfluous. So you should call it something else to avoid confusion. Like hsds_id or something so folks know to ignore it. |
Is the primary field synonymous with the record.id? An autonumber field isn't necessarily the ID. |
Airtable recently made it possible to display the Airtable's autogenerated record_ids fields with the RECORD_ID() formula so we have adopted that approach throughout the HSDS 2.0 Airtable template here: https://airtable.com/universe/expAX64T1BvtFvaHc/human-services-directory-hsds-20 |
Oh, I see. The primary field is not the record.id. If I understand correctly, all records have both, and both have to be unique. The primary field is a human readable unique id. |
Thanks @devinbalkind that will make it so folks can use either field to find related records. |
We use the primary field (Name) to link to records on other tables. So using a formula for the Name field that combines the provider name with an autonumber field will create unique human-readable Names. So, when editing the schedule column of the Help Services table, it will be easy to pick the ones that apply to the provider. |
We use text for primary fields when users might want to link that table to another using a name and use record_id when the table's row names are irrelevant (i.e. schedule). One thing to keep in mind: if you make a primary field a formula then users won't be able to create a new record by typing into the linked record field on another table. For example: if I were on an organization table and want to type a service name in the service linked record column then I wouldn't be able to do that if the primary field were a formula. Instead I could click the little plus sign, then add new record on the lookup menu, then fill out the service form that appears. |
the Help Service -> schedule linkage is doubled-up. here are some hints at fixing it:
The text was updated successfully, but these errors were encountered: