Easiest way to show dynamic Foundry icon in Workshop Object Lists

What is the easiest way to show a conditional Foundry icon in Workshop Object Lists?

My objects have a “type” property. Depending on that property, I want to show a different Foundry icon and color combination.

As a simple example, if type = “Group” I want to show Foundry’s “team” icon with color “blue”. If type = “User” I want to show Foundry’s “user” icon with color “green”.

What’s the best way to do this? I see in the documentation that “Currently, image URLs, image attachments, and media reference properties are supported” for the image shown in an Object List, but I don’t see how to use those for what I need. I don’t want users to upload images.

Asked the same question a while ago in this thread:

https://community.palantir.com/t/show-icon-in-a-object-table-based-on-propery-value/3535/3

1 Like

Not a first class solution but it works quite well depending on your workflow.

You can store your preferred icons in a mediaset and add a property to your object, let’s call it type_icon_url. Type class this property with hubble: media_url, hubble: icon and hubble:thumbnail in OMA.

When creating the object you can override the default value of type_icon_url depending of the input of your “type”-property and set the constraint to the type_icon_url of your choice.

If type is set to Group > then:

Set type_icon_url to = /foundry-data-proxy/api/web/dataproxy/datasets/RID-OF-YOUR-MEDIA-SET/views/master/A-FILE-WITH-A-BLUE-TEAM-ICON.png

If type is set to User > then:

Set type_icon_url to = /foundry-data-proxy/api/web/dataproxy/datasets/RID-OF-YOUR-MEDIA-SET/views/master/A-FILE-WITH-A-GREEN-USER-ICON.png

The logo will then be shown as the icon in a object list. I have not been able to show this icon in a Map-widget, but it works in Vertex, Workshop-table and Object list at least.

Best regards.

1 Like