|Often, data comes from multiple sources which have precedent ordering amongst them. This article shows you how to use feed mashups to get the information from the multiple sources, appropriately choosing the information from the source with the highest precedence.
To compute contact information given a phone number, where
the contact information maybe in one or both of two sources, with the first
source having preference, we first transform the sources to provide elements
that uniquely identify which source the contact information comes from (e.g.
When then combine and group to bring the two sources together, and a
transform with a coalesce to chose the first source if it exists, and otherwise
chose the second source.
The graph overview has the following shape:
First, set the repeating element in the “source” to
“row”. Then, for each source, add a
filter to get the information each source has for the given phone number:
Then, “transform” the first source feed so that the contact
information is in a “contact1” element:
Add a similar “transform” for the second feed, except show
the contact information in “contact2”.
Now, combine the 2 feeds together.
Now, group by “phone” and associate the combined “row”
Finally, use a transform to create a content element. Copy
the phone under the content element, create a new contact element with
Coalesce, with contact1 listed first as “Input” and contact2
listed as “Custom”.
Finally, publish as an Atom feed .