GET One in external collection

Hello,
I need someone experienced to give me advice or recommend a detailed guide or video about it.
I want to understand how exactly get one works in adalo.
the online guide is not very helpful in this regard.

is it possible to have a list of items with few data (e.g. id, name) in the getall and then in the get one to get all the data i need?
At the moment in the get all i get all the data of all the elements but it’s a bit heavy.

I hope to have been clear and I thank you

So I use Xano and there’s something I do to ‘get one’ but still from the GET ALL endpoint.

On GET ALL endpoint I have an input ‘item number’, then in the function stack I have an IF OR…

IF item number is not null, query records where ID = item number input.
ELSE query all records

This allows you to have ‘get one’ style functionality from the GET ALL endpoint and use it in a list.

2 Likes

hi @theadaloguy,
Tks for the reply, but I just want to know if and how the additional data that I would take in the get one of the method can be shown in a detail page,
I have done some trying and I am not able to do it.

If you have clicked to that page via a list you should have the data available via magic text, the same like using an Adalo collection.

If not clicking via a list the current data won’t be available…

If for some reason you don’t want to use a list you could use a custom action to retrieve the data.

1 Like

Hi @theadaloguy,
I’m sorry I can’t make myself understood, probably due to the fact that English is not my language.
I will try to explain myself as clearly as possible:

I have an external collection (“People” )that returns an array of names that I show in the list:
my endpoint:
www.exemple.com/api/v1/people
and the result:
[{“id”:“1”,“Name”:“Pino”},{“id”:“2”,“Name”:“Fabio”}]

then clicking on the list and passing to the new screen the “current People” I want to get all the further data of that item using the get one of adalo where I can put my own endpoint and show them
www.exemple.com/api/v1/people?id={{id}}
and the result:
{“id”:“2”,“Name”:“Fabio”,“LastName”:“Rossi”,“age”:“100”,“eye”:“brown”}

I did some tests but I couldn’t do it, I guess it depends on my error, at the moment I take all the data of everyone but this creates performance problems in the long run.

I think maybe everything needs to be in the GET ALL, as Adalo tests the GET ALL endpoint and not the others. So Adalo is only aware of data that gets returned from the GET ALL, even if your GET ONE is returning extra data.

I could be wrong, but it seems that way from my experience.

1 Like

Another idea: You could also make a completely different external collection and endpoint for the GET ONE.

Make your function stack a Query all records, but make sure it only returns one result, then have that as an external collection with a slightly different name. Let Adalo THINK it is a GET ALL endpoint, even if in reality it’s returning one result.

1 Like

Using Xano here as well, and I agree with @theadaloguy. So far my experience with these APIs is that GET ALL is the most important one. Once you learn how to properly filter by fields and use addons to get the right fields within Adalo, I would recommend making your GET ALL call be able to narrow down a record by _id.