fleapower/Google-Script-Contacts-Sync

Enhancement: In certain synced accounts, only sync certain labels/groups

Closed this issue · 3 comments

knwpsk commented

If I sync my Master account with my Work account, I would prefer to sync "all" contacts in my work account, but only those contacts with "Work" label in my Master account.

If I sync my Master account with my wife's account, I would prefer to sync only those in her account that say "share with husband" and only those in my Master account that have the label "share with wife".
etc.

(Maybe this is hard? Maybe just say that in both master and client account, only share those contacts where both accounts have a certain label to connect them? I.e. my Master account and Work account could be configured to only sync those contacts where both sides have the "Work" label. Then I can simply add "Work" label to all contacts in my work account.)

This is beyond the scope of what I need the script to do. You are absolutely free to fork the script and modify to only sync certain labels (shouldn't be that difficult).

knwpsk commented

Thanks flea. Mind giving me a start on where/how to modify that?
Do I send a parameter to connections.list() to limit the query? Where?

I suppose there are lots of ways to do that. Probably the simplest would be to only sync contacts if they match a certain label (simple if-then), or modify the GetUpdatedContacts function to only get the contacts with the labels you want.