Web Embed to render a list page: How to pass a param into web embed to use as input to list's data page?

Hello!

Would like to use Constellation’s Web Embed in an Angular app to render a Constellation List page driven by a Data Page, but need to pass the DP a parameter (the passed parameter controls what results are returned in the List)

What is the best way to pass a parameter (i.e. customerID) from the Angular app into the web embed, and use the passed parameter as an input into the Data Page bound to the List? Here’s the exploration I’ve done so far:

First, the Web Embed channel, configured to “Display a page”.

Exploration 1:

The web embed documentation says you can add additionalHeaders attribute to the web embed snippet to send key/val pairs as JSON. However, if I set a parameter that way, I’m not immediately clear on best way to retrieve it on the server side in order to pass it into the Data Page as an input. ( Maybe a Data Page that calls a wrapper Activity that uses Java to pull it off the requestor and pass it to the Data Page? That feels convoluted.)

Exploration 2:

The Web Embed JS API doc for setEmbedData says it can be used not only for an Assignment, but also for a page. So, in Angular app I could call setEmbedData(“customerID”, “123456”) before loading the web embed.

However, I’m not clear on how setEmbedData can be used with a page. I do not immediately see a way to “plumb” the passed value into the data page.

Here’s the view configuration for List page that will render in the web embed. Notice the DP takes a parameter. For the the parameter, I can only choose “constant” or “Field on operator.” There’s not an on option for retrieving it from a page property set with setEmbedData() api.

Thanks!

Exploration 1 seems to work. Here’s detailed steps/

Recap of use case: App built with another technology (in this case, built in Angular) knows about an id. Need to pass this id as a parameter to a Data Page driving a list page surfaced by Web Embed.

Two data pages:
DP_GetTasksByID that takes an id as a parameter. For this demo, it’s backed by a report def (not shown) that returns a list of tasks for that id.
DP_GetTasksByID_Wrapper that takes no parameters. It is the source of list landing page surfaced via web embed. It calls a wrapper Activity that will fetch the id from a header in the request. It calls DP_GetTasksByID and passes the id and returns its results.

Use web embed’s additionalHeaders attribute to pass key/val pair with the parameter you’ll use in data page.

The list page in web embed now shows only the records for the passed id:

@SamA17521857 Good sleuthing — I agree that having to resort to custom Java feels off though. Let me investigate the setEmbed approach and get back to you.