Fetching a single record with Custom Action

Hi
i’m attempting to fetch a single record. i am getting the entire collection returned (only 4 records in the test db). but i’m filtering and expect to get one record returned…wrong thinking or wrong code?

https://api.adalo.com/v0/apps/myAPP-ID/collections/myAPI-Key?filterBy=user.eq.{{LoggedInUserID}}

The collection i’m reading is a Profile collection and there should be one Profile for the given logged in user although User ↔ Profile is defined as many-to-many, i’m only allowing one Profile per User at the moment.

thanks!

Hi!

It looks like you’re on the right track, but let’s ensure your query is correctly structured. In Adalo, the API should allow filtering to get the specific record. Here’s how you might structure my Oneonta your API call to fetch a single record:

plaintext

1 Like

Hi @jberkley17,

I wonder where did you find such a syntax for Adalo collections API. Just in case here is the help section Collections API | Adalo Resources which describes API, and you can have the API description for your specific collection right from the app.

Also just in case you can’t filter by a relationship in the Adalo API call. You use query parameters “fitlerKey” and “filterValue”, but they don’t support relationships filtering.

Best,
Victor.

i used API doc and chatGPT… i arrived at this which is returning data from the correct table (yea!) but isn’t filtering to the single record i want —it’s returning the entire data set (only 4 records at the moment).

https://api.adalo.com/v0/apps/APP-ID/collections/API-KEY?filterBy=User.eq.{{LoggedInUserID}}

@jberkley17 the syntax is incorrect. Please read API doc for your collection in the app builder for the correct syntax. This is described in the help documentation in the link I’ve shared. If you look at the 3rd screenshot example, on the left there is a list of the possible API calls. One of them is to fetch a single collection record.
And, let me repeat, you can’t filter by a relationship in the Adalo API call. You use query parameters “fitlerKey” and “filterValue”, but they don’t support relationships filtering.

1 Like

thank you Victor!

1 Like