I’m a complete beginner currently learning how to use Palantir Workshop, and I could really use some guidance on a specific issue I’m running into.
I’m working on a Workshop application where I’m trying to display a list of items using the Property List widget. The data source for this widget is an ontology object, and it renders as expected.
However, I want to enhance this widget by turning one of the text fields into a clickable URL that includes a dynamic projectId as part of the query string (e.g., https://example.com/project?projectId=123). The issue is that projectId is not part of the ontology schema I’m querying — it’s a dynamic variable that I store or pass in from the user’s context elsewhere in the app.
I’ve tried referencing the variable in the URL field, but it seems like the widget can’t resolve it since projectId doesn’t exist on the ontology object directly. I’m not sure how to pass this variable into the Property List or combine data from the ontology with dynamic values.
What I’m trying to achieve:
Render a Property List widget from ontology data
Turn a field (like name or ID) into a clickable URL
Include projectId (a dynamic variable) in that URL
projectId is not part of the ontology schema
My questions:
Is there a way to inject dynamic variables like projectId into the Property List widget URL?
Are there examples or best practices for this kind of dynamic URL generation?
I’d appreciate any advice or direction; thanks so much in advance for your help!
If it is just a URL, then you can create the url via a string variable. Use the Variable Transform => Concat String to build the URL with your input variable.
A looped layout, which takes the ObjectSet your’e displaying + the context-specific variable as an input, and then builds the URL from there and sets it to a button you can click on. Here you are basically recreating the object view.
You can also create a function backed property/variable, in the case where there is something from the object that you’re displaying, that is needed in the URL. The function can take your projectId variable as an input, and paste it all together, even combine it with properties of the object. Check out the documentation, under “Configure a function-backed property”.
I’d ask you what you are specifically trying to achieve, since your explanation is a bit unclear as it doesn’t sound like you are using the Ontology to create that URL.
The above three approaches should give you something to work with, but feel free to share your idea if you need more help!
To confirm the understanding of the requirements, do you want to a) show an object list / ojbect table view of multiple objects, where on each row/object item an URL is embedded?
Or do you want to b) show a property list of a single object and render a URL in there? (Property lists always only work on a single object)
In both cases you can use the URL option object tables, object lists and property lists support! This is a neat functionality to define URL columns/fields. You can configure the URL being a combination of static strings and properties from within this object.
Alternatively in case b) if you want to show the URL somewhere else on the ui i.e. embedded within a text, you can use as @jakehop explained the string concatenation and embedd the resulting string in a rich formatted markdown widget.
Here is how this would look like. The trick to render a hyperlink within markdown is to use the format [prettified hyperlink of URL](actual URL)
Thank you both for your swift reply! Allow me further explain what I’m trying to achieve.
Currently I have a table widget displaying my ontology, like shown below:
Each row should have a column with a link pointing to a specific URL. The thing is, that URL needs to be based on an external variable called “projectId”. The ontology being displayed does not have that value. It is only available in that external variable. Essentially, every row should have a link that points to www.mywebsite.com/projects/{{projectId}}
I see.
Then you are running in the same limitation as many of us that local variables can not be part of vanilla URL. Imo you have to options.
Option 1:
Use function-backed column with your static local variable as input and strconcat your desired URL. Note: imo there is no way to display/value format the resulting string as hyperlink. Either the users need to right click → copy-Pasta the url value. Or see here one workaround proposed by using a custom Right-click on a table action.
https://community.palantir.com/t/can-i-add-a-url-column-in-a-workshop-table-that-shows-the-url-stored-in-a-linked-object/1168/3
Option 2:
As described above from jakehop, use a looped layout to display each object. Within that you can apply my proposed way to richformat the URL in a markdown widget.