Tobias Blickle's picture

With MashZone 1.0.1 “dynamic data source parameters” are supported. As mentioned earlier, this sounds boring, but is quite useful. To explain, I made a MashApp that provides some basic information about the countries of Europe.

You can select a country in the combo box and then some information as the name of the capital, the population, the area and a list of regions is displayed.

Let’s focus on this list: If you select “Germany” as country, so will see there the “Bundesländer” of Germany as Bavaria, Baden-Württemberg or even Saarland. When you select a different country, for example France, you will see departments as Alsace, Bourgogne or Champagne. This list is queried with the parameter of your selection in the moment you change the selection of the combo box. This is why it is called “dynamic data source parameters” ;-)

Let’s have a closer look, how it works. I use the API from GeoNames.org that provides the list of regions for a given country. E.g. by calling http://ws.geonames.org/children?geonameId=2921044 you get an XML file containing the Bundesländer of Germany. “2921044” is the ID of Germany and it is obviously the parameter to the API call. So I built the following feed:

The key idea is that the value of the query parameter “geonameid” is not fixed but  the URL is determined during runtime. To be able to so, this parameter is made a “User input text” called “geonameid” to the feed and passed to the data source using the “Create URL” operator. As a result, each time the value of the parameter “geonameid” changes, a new query is made calling the data source with this parameter and the new results are provided by the feed output.

And this is really powerful, as you can see here: The combo box with the names of the European countries is fed by this feed (without parameter, hence returning the European states as result as “6255148” is set as default in the feed):


Additionally to the names, also the “geonameid “ is fed into the combo. If you select now a country from the list, the corresponding geonameid is used to trigger a new query and display the results in the regions table:

 

Please note that the selection if the combo box is not used as filter, but as input to the feed. You can make this assigment by clicking on "Filter data" of the feed, but then selecting "user input" instead of "data feed column":

You can find the MZP of this MashApp attached. I think this passing of parameters is very powerful and I am sure you will have a lot of use cases within your own MashApps.

Keep on Mashing!
Tobias

 

Tags: process intelligence 
Attachments:Binary Data M_Geodata.mzp