This tutorial will show you how to connect two web service blocks. For instance an Excel file with all countries and a web service to Wikipedia showing information about the selected country. Or displaying a category and the products.
Requirements
- Two web service blocks (read more about the web service block);
- A common field in both the data of both web services or excel blocks.
Connecting two web service blocks
- Add both web service blocks to the App;
- Select the child block (in this case 'products');
- Go to the Advanced tab;
- Select the Advanced section;
- We will use a filter to filter out related data, in this case the filter should be:
id_category_default.value = "{data:id1}" - Now the link between the two blocks is enabled.
- In the app you should be able to click from parent to child and see a list or, when the result is only one item, see the details.
Using Input parameter filtering
In this case I used an API from movieDB to get data about films from Morgan Freeman. This results in a list with films where he played in. The other blocks ar placed a childs from the movie block.
In the data in the My Movies and Movie Details streams is a field called ImdbId so I can link those fields together.
- Add {imdbid} as a default value.
Now both blocks are linked together.
Frequently asked questions
Is it possible to add more layers?
Yes it is. As long as to blocks can be linked by a common field you can add more blocks as a child of another block.