Search code examples
palantir-foundryfoundry-workshopfoundry-object-views

How can I make sections of my Workshop module visible when an object matches a certain condition?


I am building out a Workshop module to use as an object view (OV). The object in question represents a process that has a number of different stages.

I would like to present the end user of my object the instructions for the current stage of the process, but not overwhelm them with all of the instructions for all of the stages.

The current stage of the object can be seen through the 'Status' property.

How can I hide all of the other sets of instructions?


Solution

    1. Create a string variable to represent the 'Status' property.
      1. Variable Setup
    2. Create a boolean variable to represents "'Status' != {status_1}"
      1. This will require you to write a function e.g.
        public isNOTStringEqual(string1: string, string2: string): boolean {
            return string1.localeCompare(string2) != 0;
        }
    
    1. Create a new section with the following settings except you have selected the boolean value created above.
      1. Section Settings

    This will hide the section you have created whenever the 'Status' property of the object is equal to {status_1}.