Sending a complex External Collection to a list

Hi,

I’m trying to create the FlutterMET demo app in Adalo and have come across the following issue.

The app uses the APIs described here:

https://metmuseum.github.io/

  1. I successfully display a list of museum departments using the relevant API call to create a Departments external collection

  2. After tapping on a museum department I want to display in a list in a new page with the art items that are in the selected museum department together with a photo of each item but have come up against the following 2 issues

a. the call to list the items in a particular departmentID returns a result that doesn’t have a field name for each objectID (I guess it’s a kind of array) so there is no field name to reference in the new External Collection

https://collectionapi.metmuseum.org/public/collection/v1/search?q=&departmentId=6

{“total”:27,“objectIDs”:[49006,53456,36131,40057,53439,39936,78670,49147,39901,36024,39668,53719,41483,36090,40454,48950,39931,51528,44759,40509,45652,39895,40105,40512,39569,39920,40511]}

b. even if the returned objectIDs list was returned properly I now need to make a query for each item returned in (a) in order to display the name and photo of the items in a list

So in a nutshell: is there a way to display in a list in Adalo the name and photo of items belonging to a particular departmentId?

Thanks!

How did you setup the list call for particular department? Did you already add it as an external collection? or calling the API dynamically when you click on the department?

@bhanu Thanks for your reply!

I set up an external collection using Magic Text coming from TMPdepartmentID which is a field I created in the Users collection. TMPdepartmentID gets updated using a Click Action when a particular department is tapped.

So in the following call which is used to set up the external collection…

https://collectionapi.metmuseum.org/public/collection/v1/search?q=&departmentId=6

… “6” is only an example and is actually the Magic Text TMPdepartmentID which is updated dynamically upon click.

@jginstitute is the name & photo available in another collection?

This call is only returning a list of IDs. Are you calling another url to get the name & photo?

@bhanu

To get each objects name and photo one would need to call the following API for each object where 49006 is the object ID in question

https://collectionapi.metmuseum.org/public/collection/v1/objects/49006

Honestly I have no clue how to do that or whether it is currently even possible in Adalo.

The functionality I’m trying to emulate is the same as in the FultterMET App that can be found in the Google Play store here

Any help would be appreciated!

@jginstitute

When you click on the item in the previous list, perform a custom action to call the
https://collectionapi.metmuseum.org/public/collection/v1/objects/49006

and add the record (photo & name) to a temp table and show the photo and name which is stored in the temp table in the next screen.

This will create a lot of data in the temp table but you will need to perform a cleanup regularly to avoid slowing down the app.

does that make sense?

@bhanu

What I’m trying to do is display a LIST of all the objects in a selected department

image

So once I tap on “Asian Art” for example (departmentID 6) I would be taken to a new screen containing a LIST of photos and names of all the items in that department.

The issue is that to create this list one needs to first get the objectIDs of items in that department and then to make an additional call for EACH object in order to get the photo and name.

At this stage I’m not even able to create a simple list showing only the objectIDs of the selected department because Adalo wont let me access the objectIDs in the External Collection - presumably because they are returned as an Array and not as a Collection with a property name.

Is there a way to create a simple list showing just the objectIDs if the API returns the following format?

{“total”:27,“objectIDs”:[49006,53456,36131,40057,53439,39936,78670,49147,39901,36024,39668,53719,41483,36090,40454,48950,39931,51528,44759,40509,45652,39895,40105,40512,39569,39920,40511]}

is this what you’re trying to get to?

Calling this url to get the above details:

This is causing the issue, Adalo is not able to ready this array even though the setup is successful.

you may want to use integromat to read the array and load the collection in Adalo which you can then use to call the details for each of the ObjectID.

Thanks

@bhanu

I suspected that this task would require the use of an external resource. In any case I really appreciate the time and effort you put into following this up.

Thanks!

2 Likes