Relationships with External Data

Hi guys,

Is it possible to set up a relationship e.g. a ‘follow-toggle’ between my users (Adalo DB) and my ‘Events’ (Airtable API).

TIA

2 Likes

Not directly at present, but you can create local ‘mirrors’ of your Airtable Events, and then follow those. It’s a bit messy but can work.

There is a feature request for direct relationships with external collection items here: https://ideas.adalo.com/feature-requests/p/relationships-with-external-collections

Be sure to vote if you think it would be helpful.

1 Like

Thanks! How would you create those mirror tables?

Create a Local Events collection with 3 fields - Name, Airtable id and Followers (One Local Event has many Users) and then when you click on ‘follow’ the first time, create the local copy using your Airtable information and add the logged in user. Every subsequent time, just add the logged in user to the local event’s followers.

To do this, you should create 2 x follow buttons:

  • one visible when All Local Events (filtered: ‘id’ = External Airtable Event id) > Count = 0. This one will show when you don’t have the event copied locally and have 2 actions: (1) create a local copy and (2) add logged in user to followers of that local copy

  • one in a list of local/mirrored events in your collection (filtered where ‘id’ = Current Airtable External Event id), showing only first result) to add the logged in user as a follower of that local event. Set the list only to be visible if All Local Events (filtered: ‘id’ = External Airtable Event id) > Count not equals 0.

Your ‘unfollow’ button will then just remove the logged in user from your local event’s followers.

3 Likes

Thanks Darragh! Really appreciate it.

Gonna give it a try.

Ok, got the first step ok (adding the users to the mirror table), but can’t get the visibility step to work. I’m using a list, but am not able to use the current list item to reference the local_mirror (closest I get is the infinite loop).

Lmk if you have any ideas or is this not possible?

P.S. I did make one change to have users >< events as multiple for both relationships.
PPS. Ideally I wanted to use the toggle, but assuming that’s not an option?

Here’s what I have currently.

That many-to-many has messed you up. You need the custom filter to be able to say ‘is equal to’. Once you have it as one-to-many, you can use the toggle in theory, but see here for how that can cause issues with your workflows: https://ideas.adalo.com/feature-requests/p/toggles-split-actions

You can create a ‘toggle’ with much more flexibility in future by following the guidance on this thread: Is here a way to hide an element?

Ok, I followed your post exactly and got it working TG. (Didn’t do the second flow yet to avoid adding if already exists, but should be straight-forward).

However, I can’t remove the user. Only the ‘create’ workflow gives me access to the local Events Mirror. The update and delete only reference the external events (airtable) and the user db (in which I can’t see a way to remove the Event either).

What am I missing?

Thanks in advance!

Hi, just want to bump this up. Can anyone help?

Hi Ajay - you need to put your remove button inside a list like the second add button:

By doing this, you will have access to ‘current mirrored event’ and be able to remove the current user.

Hi Darragh,

Remove button already is in the list (actually it toggles visibility opposite to the add button, which works fine). I DO see the local mirror in the ‘create’ action, but not in the ‘update’ and ‘delete’. Does that make sense?

It does. How is your relationship set up? Is it “Followers” in the local mirror may have many users? Or users may follow many Local Mirrors? Or both?

Another thought is to check that the button/action is actually in the list and not tucked behind it only showing when it does? You should be able to “create” a local mirror from any screen/area.

As per suggestions, the User can follow multiple events, but the events can only have one user (Not ideal, but I’m assuming in future we can create a new local event for each user to follow - my pref would have been many to many relationship).

I know the button is ‘in’ the list because it shows up on each line, when relevant.

@Ben can you help here? TIA

@AJAY can you share of video or screenshots of your set up now?

  1. I am able to CREATE a new record in my localeventsdb


2. I create a new event in my mirror (localeventsdb) copying the data from the current event (API Data), and create a beautiful relationship with the logged in user.


3. I am NOT able to UPDATE or DELETE data in the localeventsdb. Ideally I would like to delete the very record I previously created on this same screen.

I did just discover a work-around, using a separate screen with a list of data from ‘localeventsdb’ which allowed me to delete the record, but it’s far from ideal and I would like to know if I missed something, or at least understand why some actions work and some don’t.

Looking forward to your response. Really appreciated, @Ben

@AJAY

The update the “Current localeventsdb,” the button needs to either
a) be in a list of “localeventsdb”
or
b) on a screen that has access to “Current localeventsdb”

@AJAY I think you need to put the remove button inside the same list of the 2nd button. I’m trying something similar. It seems working for me.