Using data from 1 collection to search another collection on a new page

Hi,

I have 2 screens -

Screen 1 runs an external Xano collection and pulls basic data on the last 5 orders.

Screen 2 is called when the user clicks on any of the orders. This screen should show more details order data as well as data from 3 other tables. I have the Xano API setup with Addons to pull the data from the related tables and it works fine when run in the browser.

What I essentially to do is to take the order_id that is selected from screen 1 and run the collection on screen 2 to display the data.

I cannot figure out how to get the order_id when I am on the second screen to use in the collection.

Hope that this makes sense.

Thanks

Steve

Hi Steve,

In the screen 2, do you see order data avaiable or unavailable from screen 1? If the data is avaiable, the id might be missing from the output in GET (query all records) endpoint/request, you need to go into the function and customize the output, let me know if you’re unable figure out!

Thank you and have a great day!

Hi Dilon,

On screen 2 I can see the order data and under Available Data is the first collection but nothing else.

If I add a list I can connect that to the second collection and can filter it by order_id but that data is only available in the list - I am unable to access it for a text field (for example).

Am I correct in assuming then, that I have to connect the list on the first screen to an API that pulls all of the data and then as I move from screen to screen, filter that data to show what I want? If so, isn’t this a waste of resources?

I saw somewhere else that suggested that there was a way to attached a collection to a screen - is that correct?

Thanks

Steve

Hi Steve,

Thanks for the information!

You’re trying to access a list of values from another table linked to an order in a text component? To show a list of values, you need a list. Or you could turn it into a comma separated list/joined list which returns a text that can show in the text component. What’s your end goal, quick example with some screenshots?

Thank you and have a great day!

Hi,

Here is one particular use case

So, I just want to pass the athlete id to the second page and then run queries on a new collection there. I can do it in a list but if I just wanted to put discreet text using Magic Text I don’t have access to the data. Pulling all the data on the first screen, just to be able to pass it to different screens seems like a waste of resources to me.

I saw somewhere that you could attach a collection to a screen, is that correct?
The availability of variables would also solve this situation.

Thanks

Steve

Hi Steve,

Thanks for this information!

After clicking on an athlete, directs to the detail page? Or is it after selecting an event too? If it’s a single item, you can retrieve the result record and the event record using an addon in the athletes endpoint but in this case, I can see it’s multiple which needs a list component instead a text component. You can map athlete data from previous screen in a text component such as id, name, club.

Attach a collection? Do you’ve the topic link?

If you need to do something like, click an athlete > show their results with the event details, you can add an addon into the results GET endpoint to retrieve the event details from the event_id and in the detail screen you can use a custom list to display the results mapping the result, event details, filtered by the athlete_id from previous screen.

Thank you and have a great day!

Hi Dilon,

I know that I can retrieve all the records using addons.

What I am saying is that in dealing with other app generators, I would get the athlete data on the first page. When the athlete is selected, I move to the second page where I retrieve all the data for that specific athlete.

What I am understanding with Adalo is that on the first page, I have to retrieve all the data for all of the athletes, and then one I go to the second page run a filter on that data to display.

What if I have 500 athletes with hundreds of results each? That is an incredible amount of data to be pulled and not be used if the user is only searching for 1 or 2 athletes.

That is what I find confusing and a waste of resources.

If Adalo would allow either

  • variables which could hold the search criteria, the the needed data could be pulled on each page
  • or the ability to attach a collection to a page

I think this would cut down on use of resources.

Steve

Hi Steve,

So instead a list of athletes in screen 1, you need to have a function where you enter the athlete name/id in a search box in screen 1 and clicking on the search button, display that athlete or just enter the athlete name/id & go to the screen 2 with that input which retrieve the athlete data in screen 2? Am I understanding this correctly?

For lists, you could use pagination or use an is equal param for the list if you’re search input is athlete id.

Noted on this one! : App and screen level variables

Thank you and have a great day!