Task 3 – Navigate to Exchanges within a Folder
This task will guide you to retrieve all topFolders that are available within a project. These topFolders, in turn, contain a list of subfolders from which we will retrieve the exchanges.
By the end of this task, you will be able to:
- Retrieve all the topFolders and its sub-folders that are available within a project.
- Retrieve all the exchanges that are available within a folder.
You will use the following queries in this task:
Type | Operation | Description |
---|---|---|
Query | topFolders | Retrieves all the topFolders that are available within a project. |
Query | folder | Retrieves all the exchanges that are available within a folder. |
Step 1 - Request a list of Top Folders.
The following steps demonstrate how you can run the topFolders query and retrieve the Folders available within the topFolders.
- Enter the following query in the Query Pane of the Data Exchange Explorer.
Query
query GetTopFolders($projectId: ID!) { topFolders(projectId: $projectId) { results { id name folders { results { id name } } } } }
Show More - In the Query Variables Pane, enter value of the
projectId
, To know how to obtain theprojectId
, refer to Task 2 - Get Projects.Query Variables
{ "projectId": "cHJvan5iLjc2OGNhZTE0LTc2YjMtNDUzMS05MDMwLTI1MjEyZGFiNGU0OH5iLjIyYTVkYzQ3LWNhMTktNDIzMS05ZjNlLTE1N2ViZDQ4NDJmZg" }
- Click Play. A list of topFolders with their respective sub-folders within the selected project in returned in the response.
Response
{ "data": { "topFolders": { "results": [ { "id": "Zm9sZH5iLjc2OGNhZTE0LTc2YjMtNDUzMS05MDMwLTI1MjEyZGFiNGU0OH5iLjIyYTVkYzQ3LWNhMTktNDIzMS05ZjNlLTE1N2ViZDQ4NDJmZn51cm46YWRzay53aXBwcm9kOmZzLmZvbGRlcjpjby40U0F5Z29SSFNjZUllVUlySVMtSUxB", "name": "Project Files", "folders": { "results": [ { "id": "Zm9sZH5iLjc2OGNhZTE0LTc2YjMtNDUzMS05MDMwLTI1MjEyZGFiNGU0OH5iLjIyYTVkYzQ3LWNhMTktNDIzMS05ZjNlLTE1N2ViZDQ4NDJmZn51cm46YWRzay53aXBwcm9kOmZzLmZvbGRlcjpjby5ON21kU05TSFR3Nk81dWNualhsSjJR", "name": "Large-models" }, { "id": "Zm9sZH5iLjc2OGNhZTE0LTc2YjMtNDUzMS05MDMwLTI1MjEyZGFiNGU0OH5iLjIyYTVkYzQ3LWNhMTktNDIzMS05ZjNlLTE1N2ViZDQ4NDJmZn51cm46YWRzay53aXBwcm9kOmZzLmZvbGRlcjpjby5TWW9LbnlJNVJOU3pmNVBVeWlqNXB3", "name": "Small-models" } ] } } ] } } }
Show MoreThe folder ID is essential for querying the list of
exchanges
within a specific folder.
Once the query runs successfully, your explorer should resemble the following image.

Step 2 - Request a list of Exchanges that are available in a Folder.
The following steps demonstrate how you can run the folder query to retrieve a list of exchanges that are available in a Folder.
- Enter the following query in the Query Pane of the Data Exchange Explorer.
Query
query GetFolder($folderId: ID!) { folder(folderId: $folderId) { id name exchanges { results { id name } } } }
Show More - In the Query Variables pane, enter the value of the
folderId
. You can obtain thefolderId
from Step 1 of this task.Query Variables
{ "folderId" : "Zm9sZH5iLjc2OGNhZTE0LTc2YjMtNDUzMS05MDMwLTI1MjEyZGFiNGU0OH5iLjIyYTVkYzQ3LWNhMTktNDIzMS05ZjNlLTE1N2ViZDQ4NDJmZn51cm46YWRzay53aXBwcm9kOmZzLmZvbGRlcjpjby5ON21kU05TSFR3Nk81dWNualhsSjJR" }
- Click Play. A folder with a list of exchanges is displayed in the response.
Response
{ "data": { "folder": { "id": "Zm9sZH5iLjc2OGNhZTE0LTc2YjMtNDUzMS05MDMwLTI1MjEyZGFiNGU0OH5iLjIyYTVkYzQ3LWNhMTktNDIzMS05ZjNlLTE1N2ViZDQ4NDJmZn51cm46YWRzay53aXBwcm9kOmZzLmZvbGRlcjpjby5ON21kU05TSFR3Nk81dWNualhsSjJR", "name": "Large-models", "exchanges": { "results": [ { "id": "ZXhjfnlwdWFzY1NicWlIT0R1R0s4OUkwTHdfTDJDfjgwNDg4OWIzLTk0YjAtMzFkOC1hZTBiLWUxNmM5ODJmMTM2NQ", "name": "SHARE - First Floor" }, { "id": "ZXhjfnlwdWFzY1NicWlIT0R1R0s4OUkwTHdfTDJDfjI0ZjQ0MmZkLTcxYmQtMzNmNi1hMDg2LTk4NTZjZDUxYmEyMQ", "name": "SHARE - Overall" }, { "id": "ZXhjfnlwdWFzY1NicWlIT0R1R0s4OUkwTHdfTDJDfjkwMGM5ODY1LWI2ZmMtMzI0Ny04NWUxLTgxMmZhOGY1ZTJkNA", "name": "SHARE -Multi-Fam Apt-Wing 2" } ] } } } }
Show MoreThe exchange ID is essential for querying exchange information like the exchange ID, name, propertyDefinitions, and so on.
Once the query runs successfully, your explorer should resemble the following image.
