Since I felt the same pain of not being able to edit my google contacts from within Coda
, I decided to take stuff in my own hands and create a pack.
Since this is my first Google related pack and Google is doing Google things, I had some headaches dealing with getting this pack working. If you spot something that could be improved… let me know. I am considering getting this verified as that will be easier for the user but that will take some time and wanted the community to try it.
NOTE: This is not a verified Google App so you have to create a Google Cloud project where you will set this as an internal app.
NOTE: You have to create a PRIVATE pack also and then you can use it within your Coda Workspace, which is fairly easy.
Find instructions on how to setup your Google Cloud Project & App on Github
Also, source code is available on the pack listing so feel free to check it out.
8 Likes
this is great! i’ve got the 2 way sync working per your setup guide, but i’m not able to allow new rows to be added to the sync table for creating new contacts. i’ve got 2 way sync enabled. anything i’m missing?
@Connor_Stobaugh You have to use the create contact button (column or canvas button depending on where you need it) and link all the fields/properties to existing fields in a table if needed.
You can enter formulas is those fields (given name, family name etc) using the space & = command
In sync tables you cannot add rows using the + sign at the bottom or the button on top right that you normally have in a native Coda table.
As you can see that bottom button option is missing.
Ok, that’s what I figured. Had never seen a sync table with the ability to add new rows. You might want to update step 4 in the setup guide:
Noted, I updated the setup instructions. Thanks for pointing it out and if you have any specific feedback, it will be greatly appreciated.
Hi, your new pack seems very promising but I am not yet able to test it: I tried to follow the detailed setup guide but the call from the pack to Google fails for unauthorization
Error at line 426: 401 - {"error":{"code":401,"message":"Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.","status":"UNAUTHENTICATED"}}
The pack in settings does have Client ID and Client Secret from Google, as well as Google Console, Authorized Redirect URI is set to https://coda.io/packsAuth/oauth2/..pack..
What could I check/do?
Thanks a lot
Giuse
Maybe because the test user email is different than my email in coda? But I cannot add my Coda email in the tester list in Google console…
New major update! I added a few extra things, modified some others with some being breaking changes.This is a major version update that significantly expands the initial Google Contacts pack capabilities.
Later EDIT!
This pack is in beta… DO not use in production until stable release is confimed!
From this version onwards you can expect no more breaking changes but cannot promise as this is still a work in progress. I am exploring a dynamic schema but since I haven’t dealt with that
before… is a bit of a challenge.
Feel free to give it a try and share your feeback, it will be much appreciated!
New Features
-
Extended Name Fields: prefix, suffix, middle name, phonetic names, nickname, fileAs
-
10 Email Fields: Each with customizable labels (work, home, other, custom)
-
10 Phone Fields: Each with labels (mobile, work, home, fax, pager, etc.)
-
10 Significant Dates: Birthday plus 9 additional significant dates with labels
-
10 Custom Fields: Fully customizable fields with labels
-
5 Complete Addresses: Street, city, postal code, country, PO Box support
-
Batch Operations: Add/remove multiple contacts to/from groups
-
Enhanced Validation: Better data validation and error handling
Breaking Changes
Version
This represents a major version update (V1 → V2) due to significant feature additions and structural changes.
2 Likes
!!! New update, and this pack is a hell of a beast! Please give it a try and let me know what bugs you can spot. It is NOT production ready yet.
1 Like
New update is great! Looks like addresses are missing the state/region field though.
Yeah I know, I am looking into how I can pull in all the possible regions while at same time be able to build the pack as if I use the full ISO 3166-2 json…. itt becomes a mamouth and cannot be build in pack studio.
I am trying to find a smooth user experience with it… like having a dropwdown to choose from rather than free form text where you just type lets say Alabama as some may type ALabamaa by mistake. It’s easier to implement strict static options rather than free text + validation but that means size becomes an issue!
makes sense! a list would be great if its possible.
one other question. is there anyway to allow column types to be changed? ideally i’d like the organizations column to be linked to a table with all companies. or perhaps that could be coded as a third sync table. a list of all organizations that is linked to the organization column on the contacts table?
You can definetly change the type for the organization column. In essense what the api needs is a string (text). Just create manually a normal native Coda table, call it DB Companies or whatever and then create a relation to the organization column.
yeah, i tried that but whenever the table is refreshed it reverts the values to plain text and breaks the reference.
Ohh… the sweet soft references.Yeah sorry about that!. The one way around is for you to create the organization/companies local table and add/update/remove companies as you want, create a relation to the sync Contacts table and use the update pack action button to update the organization value with the one from the relation (company)
A drop-down list based on the value of country would not be possible (similar to current country drop-down list)?
Or I can accept error popup when sending edits to Google if the value is wrong more than having additional buttons to send just the region to Google that would break the “send edits immediately” option of the pack.
Yeah, I’ve got a workaround like that. Ideally it would just be one column for the organization that is a dropdown and linked to an Organizations table.
I think this would be possible if the Organizations table was a sync table in the pack as well. Then they should be able to link to each other (other sync packs with multiple tables do this). I’m not much of a coder, but I messed around with chatgpt and was able to get the organizations sync table to work, but haven’t figured out how to relate them yet.
Would be awesome if you could add to the pack!
There are limitations in what google api & coda pack sdk is allowing.
-
there are schema limitations meaning that pack sync tables havea static schemas that are defined at build time (I define them statically). I cannot pull dynamically data in a dropdown so that the user can select something from the dropdown while editing the sync table in Coda. To overcome this I will have to hardcode 250 countries and some 5000+ regions/states which is a no go for pack sdk.
-
The organization & all states fields (primary to the 5th one) will be free text but I advise that to modify, create a local table in the specific doc or through cross-doc from a central utillity tables doc and then just as I showed above, create a relation to this subdivisions table that the user can choose from and by using a button, edit the state.
This problem with free text especially for the states fields is that there is validation on google side, which I cannot access. So there will be cases when the user might input some who knows what state/region in france in their own language which might be different than the ISO 3166-2 that google is using when they validate data… and the user will be stuck in finding the right text to input as I cannot tell through the pack to the user to use X form rather than what they typed and maybe what they actually know.
ok, the free text case depends on the type of users, in my personal case it’s just me o technicians so no problem in giving a “incorrect region value (see ISO 3166-2)” popup message and I can provide a link to ISO 3166-2 - Wikipedia or relation the field to an internal column where to find selectable values. I just don’t like that other fields can be modified and automatically sent to Google Contacts… except one that needs an additional button press (if the user remembers to do that).
There is no popup to provide as these fields can accept any free-form text as Google doesn’t do any validation.
For both organization & state/region fields I recommend the the approach I used for the organizations just above.