Workshop Variable Embedded Module

I am trying to find a way to embed specific modules into my main workshop app. I have an object list of ontology objects, and depending on the object selected, the displayed embedded module may be different (or there may be no module at all).

I realize that I can set up individual sections, each with their specific module and hardcoded conditional visibility boolean variable in the workshop application, but with a lot of modules that becomes difficult to maintain.

Is there a way to do this easily (i.e. a way to programmatically access the modules to embed)? For example, via a link stored in a property on my ontology object that I can use in workshop to display a specific embedded module when that object is selected?

1 Like

Hi @rebeccanhan does your object list contain the union of multiple object types and you want to show a different view per type? Or do you have one object type where you want to switch the view based on a property like a type/category?

If first, you can try out to use the object view. In OMA you configure the object view per object type. When you click on "edit full view in the top right, it will open the editor (that is workshop). In there you can either directly develop your custom view directly or just embedd another individual workshop module.
In your main workshop app you just have a section that has the object view widget. The input to this is the selected object from your object list. Tip: If you are wondering how to hide the tabs/header from the object view - you control this here, not in OMA.

We used this exact way in a use case to show orders of different types within the same table (production, planned, purchase). User clicked on a row - an overlay opened with details of that order specifically tailored to the type.

If 2nd: you could use a tabbed layout and switch the tab variable-backed. I would make the tabbed widget part of the embedded module itself. If you name the tab exactly like the category values you want to switch over, you can just extract that object property. If then do a simple variable transformation inbetween to translate property value → tab name.

Generally, approach 1 will be the nicer with less maintanence, but would only work with different OTs. Independant in which foundry app you would call the object view, it would always appear the same way (not only in workshop).
In approach 2 you would always need to update the tab layout if you have a new value. But should give you generally the same result.

Another idea if this is more “data driven” - i.e. you need to show different modules based on some property value(s) in the active object selection: “ontologize” your modules by building a little object type that stores an ID (could use the RID of the module or a UUID) and the RID of the module as properties. Then depending on your use case and data model you could define a many-to-many link type between the objects in your primary object type and the relevant module or you could add a property to the module object type so you can easily filter to find the right one, based on a property from the selected object in your list.

Either way, you could then use the “Custom Widget via iFrame” widget and a variable-backed URL to dynamically select the module.

All that said, if you only have a few modules to swap between, you’ll get the best performance I think by using a tabbed container with the header hidden and a variable based on the active object selection determining which tab to show with the relevant modules hard-coded.

2 Likes

Thank you for the response! That is definitely something along the lines of what I’m looking for with the dynamic selection via a variable backed URL.

However with the “Custom Widget via iFrame” widget, when I use the URL for the workshop it keeps the Palantir left sidebar since it’s embedding the entire webpage and I don’t want users to click/see that.

I wish that this was possible by referencing a URL/RID/reference in the module embed widget instead of a manual select (like the PDF Viewer/Media Preview lets you do with documents). Hopefully there’s a way to mimic that somehow.

Hi @rebeccanhan
You can control the visibility of the Foundry sidebar through the url parameter embedd=true.
https://www.palantir.com/docs/foundry/workshop/widgets-iframe/

And mighty fist bump to @lrhyne for the creativity :right_facing_fist::left_facing_fist:

1 Like