How can I enrich a presentation of a document with data provided by a 3rd party api?
An example use case would be a shopping list. Each item of a list refers to a product where the details like description and image, etc. are provided by the 3rd party api. When viewing the shopping list the user should see the description and image for each referenced product.
The backend for the shopping list itself doesn’t need the product details and should be unaware of those.
In such a scenario how would one go about implementing this enrichment of data for form, overview and content engines?
Hi @andreas-fresh-mesa,
I think you could use a data loader to add the data from the 3rd party api into the activity. Depending on how/where the data should be displayed, you can customize the form/overview and access the data from the activity. For more information you can take a look at the Client documentation on data loading.
We also have a task in the Frontend Tutorial on this topic (Task 4 - Data in Activities) with the example of loading data for a pie chart from the server.
You don’t need to do the other tasks to understand it, as they can be done independently of each other.
Though maybe the Task 2 - Overview Customization and/or Task 3 - Form Customization could be interesting for you as well.
I can however only speak for the form and overviw engine. But I will forward this question to the content engine team.
I hope that helps a bit,
Denise
Hi @andreas-fresh-mesa,
Since you tagged the content engine, I assume you need a different view for the shopping list instead of the default table view of the overview engine, right? Currently, the content engine does not provide any data binding mechanism; all necessary information to render the content has to be provided within the content model. However, we are working on that binding capability (actually re-implementing it, see below), which will allow a content model to be linked to a document model and extract data from it.
In the past, we experimented with an approach to render a tile view instead of a table list view for the overview engine, where each tile is the result of the content engine for each document. This approach allowed us to reuse other useful features of the overview engine, like filtering and searching.
Best,
Nam
Hi @andreas-fresh-mesa ,
did the reply from @nam-secure-mesa answer your question or do you need further support?
If it is solved, please, use the checkbox to mark the solution to your problem so that other users also know what helped in your case.
Denise from the Discourse team