Hello everyone, this might be a very simple problem but I can’t for the life of me figure out how to solve it. I’m trying to create a simple connection between a contacts table in Notion to Google Contacts and sort them out by group.
Steps taken so far
So far, I’ve filter out those contacts with no groups, and that works just fine. Then filter those with group existing and it works, but if I add a fallback option in case it does not find the group name, it goes to that one by default on the first try, rather than iterate through the whole list first. How would I go about this?
Hello @cchulia, I think sharing your blueprint here would be helpful. Because we don’t know which variables are being used in the filters, and it’s possible you reused an earlier one which is causing the outcome you get.
In looking at the filter, I see 2.name looking to match 27.name. However, it’s possible these don’t align as you expect. Instead, given that 27.name exists, should be enough to proceed with that branch.
My problem with that solution is rather than iterating through the whole list and then deciding its not there, the moment it checks the first item is not it, it defaults to the other branch.
So, the main goal was to sort through a Notion database and import the items inside as contacts. Name and most “common” fields are fine, but getting Contacts to accept Tags as a group was a challenge.
My original blueprint tried to:
'2. Watches for new contacts and updates. —>
'21. Router: One route creates filters database items with no Tags, and crates “simple” contacts, with no group. The other route moves all items with tags along. ---->
Here’s where things get tricky, it might have a simple solution but I couldn’t figure it out at the moment. I tried different solutions and the one I ended up with was:
'19. Lists all groups already created ---->
'23. Router: Creates two routes. In one, the filter checks if a group name the same as the Notion tag exists. If it does, it creates a contact and adds it to the group. If not it goes the other route, creates a group with that name and then creates the contact.
The reason I needed the filter to iterate thorugh all the input was to check if the name in Tags corresponded to ANY group. The way it is now, it checks if it is equal to the first group (bundle 01) and if it just so happen to be, great, if not, rather than checking if it is equal to any other group, it just goes the other way and tries to create a group with that name, which might give an error if the group existed and was in another bundle later.
Anyway, my current solution uses a “Tools” module to map the groups into one variable and then the filters check if the resulting string contains the tag. Not the most elegant, and I’m trying to improve it, but it sort of works.
One option is to pull the groups at the beginning to then do a contains check to then decide creating or not that group. The challenge is when the groups change because an earlier new contact has tag Z that gets created and a later contact wants that tag too.
It’s possible to work around these, yet frankly we’re not dealing with an efficient solution.
Ideally it would be running on a schedule, so I could add contacts in Notion and have it be updated for Gmail and my phone contacts. (And the other way, though that’s a whole different problem)
So we could iterate through them, when a match is found link it as desired. When no match is found after iterating through all, then we go to a fallback route, but not the built-in one.
More of a prior router, next branch that gets variable group found, and when that’s false, then create the group and associate the contact.
Similarly, we could use that group found variable to stop processing further modules, though the iterator will continue until done.
PS: Not relevant to this topic, but I can’t play the video on the message, not sure why. (Edge and chrome show the play botton grayed out and firefox just shows format invalid.)
This is a known issue of Discourse, the software the community is built on. There is a way of fixing individual videos, but we need to keep track of them manually. It seems that we missed this one and I’m sorry about that. All should hopefully be working now.