Hi guys - is it possible to merge two APIs in one repeating group when the API has different subtypes? For example, if you wanted to create a product search application that aggregates listings from Amazon and Ebay and show the results in one repeating group with the product image next to the product item title.
I believe you can merge two separate API results in a repeating group if you are only returning results of the same type (e.g. text only or numbers only), but that’s doesn’t help if you wanted to aggregate a list that returns a text type, image type, and a number type that are all related/required.
This topic was posted in 2016. Does anybody (or @emmanuel) have an updated solution for it now?
Let’s say I want to have an RG with two different types of data, for example, ‘eBay products’ and ‘Amazon products’, both have ‘productName’ and ‘price’, which is all I need for this RG. How can I put both APIs’ data into one RG?
I could download it into my DB and generate this RG, but it wouldn’t be very efficient… Does anyone have a more elegant solution? Thanks a lot!
No: The same first answer apply: you cannot use two data source in one RG.
Yes: There’s a workaround, like instead of setting data source to the API Type, you set it to text and you merge the list of ID from one data source with the list of ID of the second data source (you can also use :format as text for a more complex text string list). Using conditionnal and a group for each data source type, you will display the correct group based on the ID (if you find it in data source A, display group A, if you find it in group B, display group B instead).
No: In the end, is it really an interesting solution? Think that you cannot really sort the list (based on ID…?). In the end you end up with a list of data source A merged with and followed by the list of data source B. At this moment, it may be easier to just have two RG on top of each other.
Yes: Another workaround, is to create a DB thing where you will be able to merge different data source. However, this will cost a lot of WU and if you call API each time a user enter a request, it will slowdown your app a lot. This is a solution that sometimes can make sense but not in most case.