Contents: MashupHub User and Administrator Guide : Mashup Center 2.0
Use the For Each operator to associate the data from two feeds based on a key value that is common to both feeds.
The For Each operator takes values from each repeating element in a feed and fetches data from another feed based on a variable in the second feed. The variable in the second feed is substituted with the values from the first feed. The output contains the data from the first feed and the fetched data.
The second feed retrieves data that relates to the values in the first feed. For example, the first feed is a list of locations that include a zip code. The second feed contains information about medical facilities. For each zip code in the first feed, the URL from the second feed is run so that the medical facility information can be returned, based on the zip code.
Select a parameter from the first list. The values for the parameter in the first feed will be used to populate the second feed
The second feed must contain an explicitly declared variable or an implicit variable from a Source operator. Multiple key values and variables can be used to select from the second feed.
For each entry in this feed
Select the feed that contains the values.Name
The text to display on the For Each operator image on the canvas.Specify parameter from operator name
The variable from the second feed. The variable can include the entire URL or any part of the URL.Specify value from operator name
A value that can be computed from a value in the first feed.
You can specify one of the following:
- Specify a text value.
- Specify a function value.
- Use a variable to return the value.
- Specify a value from the Input tree.
If any of your sources is a feed from the catalog, you might want to change the feed type to XML. When you specify a catalog feed, the data mashup builder automatically selects the feed type that the feed was registered under. Changing the feed type changes the list of repeating elements that you can select from. Using the list of XML repeating elements can improve the output from the For Each operator. To change the feed type, open the Details window for the Source operator and use the Feed Type
field on the Advanced tab.
The For Each operator is used in the National Park Forecast
data mashup example. You can access this example from the Getting Started actions on the Home:Catalog
Parent topic: Operators : Mashup Center 2.0
Operators : Mashup Center 2.0
Tips for better performance in the data mashup builder : Mashup Center 2.0
Filtering by node position or by element attribute value : Mashup Center 2.0
Variables : Mashup Center 2.0