Show icon in a object table based on propery-value

Is there a way to show the native icons in an object table?

You can use the windows native icons, but they are kind of bad looking, and doesn´t match the style of the other workshop-icons.

For example if i make a function-backed column that looks at a property and then sets a icon.

looper.all().forEach(loop => {

   If (property === "listening") {
      var icon = headset;
   } else if (property === "singing") {
      var icon = singing;
   } else {
      var icon = jumping;
   }

   map.set(loop, icon);

}

Example output:
:headphone: | Listening
:microphone: | Singing
:headphone: | Listening
:kangaroo: | Jumping
:microphone: | Singing

Hey,

Do you mean something like this? This is a notional example (object table widget in Workshop) with album covers as custom icons instead of the color + icon combo selection on the Object Type configuration in OMA.

@joshOntologize I like your creativity using images as icons :slight_smile:
I understand @bobbyb‘s request that he wants to dynamically set the icon based on conditional comparison of one/multiple properties. Your case would work with static images, or does that also work with conditional rules?
I imagine his example to be a list of users and you want to understand their current state of activity.

I have two ideas in mind, both might not be perfect but let’s see how far we come :slight_smile:

  • in the ontology manager > properties > display you can set the visibility of values to „Fixed values“. So you can e.g. translate a false/true or any other string/numeric value into whatever string you want to display. Without having my laptop at hand, the only think I am doubtful is, if you can use icons in there.
  • in the markdown widget you can use icons. Additionally you can build tables (best to check the doc). Basically you would generate through typescript your string for the markdown table

@joshOntologize something like that, but instead of using individual images i want to show one of the native icons. A better example of what i want to achive:

@phil_m if i use markdown i loose the ability to apply filters to the table.

I don´t think you can set fixed values in the properties > display? I only see visibility normal, prominent and hidden. Then you have the conditional formating, but that only apply colors.

@bobbyb Is the target property something that can change via an Action Type or will it be mostly static?

If it’s the latter – and assuming there’s a low cardinality of total unique values for the target property, then you can:

  1. save the icons as images (.jpg, .png) and upload them to a manually-created Media Set
  2. use pipeline builder to left-join each icon/image to the backing dataset of your Object Type (you’ll need the “media_reference” column that looks like a JSON object with Foundry RIDs)
  3. create a Media Reference property on your Object Type based on that new column
  4. you’ll now be able to display this as a new column in your Object Table (just move it all the way to the left and use an empty string for the column title)

If it’s the former, you can:

  1. create a simple ENUM object type with two properties: one contains the different potential values for your target property, and the second would be the same Media Reference property mentioned in steps 2 and 3 in the above scenario
  2. create a link type between your main Object Type and this new ENUM object type
  3. in your object table widget, add a property on a linked table > (ENUM object type) > media reference property (then again move all the way to the left and use an empty string for the column title)
2 Likes

Had hoped for something quicker/easier :laughing:
Maybe i will try your first example when i am done with the “must have”. This is more of a nice to have.

Thanks alot Josh!