Retrieving External Collection Record

I might be completely missing something, but I’m struggling to figure out how to get a single record from an external collection (Airtable). I’ve been able to connect to Airtable and display a list of records. What I need to do, is post login, is take the login email and get the record from Airtable where a field matches the email. All the custom action options are only Create, Update, and Delete. Help would be appreciated.

Hi @devmy,

Welcome to the forum!
You can get a single record in 2 ways:

  • if you have a list of records and then link this list entry to the next screen - you will have a Current record there
  • or you can use filtering with filterByFormula. It is described here: Filtering Airtable Lists | Adalo Resources.

Best,
Victor.

Hi @Victor,

Thanks for the response. In Airtable I have a table named “People”. I’ve set it up as an external collection. After I login with an Adalo user, I want to get the People record that matches the email and then get the ID field and save it in Adalo. Because of this, I don’t have a list I want to display in the post login page. B/c of this, I’m a little confused how the two options would work.

It seems that Adalo just has the concept of lists and not a way to retrieve a single record from an external collection in a custom action. Am I correct?

Best,
John

Hi @devmy,

Yes, data access in Adalo apps is build around the concept of Lists → List Items. In order to get access to one data row (Item), you need either to have a list → access to Current Item on the next screen, or you can build a single-item list (filtered in a way so that you have access to this exact row).

You’re right, with External collections you may want to try using Custom Actions to get the data from exact row. So, in your case the options are:

  • add a custom list in post-login screen. Put a button there. Filter this list in a way so that only an Airtable record with user email = logged-in user email is displayed (filterbyformula, see help article from my previous post). Add an action on a button/icon inside this list, to update logged in user using information from Current item of a list.
  • without a custom list - just add a button, create a custom action connecting to Airtable and update a logged-in user using custom action result.

Important notes:

  • you can’t put custom action to on-screen-enter actions, as it’s not possible to process its results
  • you can’t put custom action directly on Login/Signup screen(s), as logged-in user does not fully exists there
  • make custom action conditional, so it’s not executed every time. I believe that user IDs aren’t changing, so you can call an action only if Logged-in User → UserAirtableID (call it this way) is Equal to Empty (leave blank).
  • same applies to single-item list
  • or you can make button / list conditionally visible so it does not display at all when UserAirtableID is set
  • as more advanced workaround, you can try using countdown timer. It is highly advised to make it conditional (so it is visible and executes only id Logged-in User → UserAirtableID is equal to empty). Then you put 1 second to countdown. You can use both custom action and single-item-list approach with a timer.

Hope this helps.

Best,
Victor.

Hi @Victor. Thank you again for your response. Your suggestions and notes were helpful, but unfortunately, I don’t think I can figure out a way for Adalo to support our use case. I think what I need is a Custom Action that can take a parameter. That parameter value would be pulled from the logged in user. I’m going to try a couple more things before our trial ends and if I can’t get it to work, I’ll have to move on.