palantir-foundryfoundry-workshop

How can I select first value of the dropdown by default in Palantir Foundry Workshop?


I have a string dropdown populated by a variable in Workshop. I would like the dropdown to select the first value by default when the underlying set recomputes. How could I do that?


Solution

  • In a case like this, you have 3 object sets (one of which is the currently-selected object), plus whatever changes the "input" object set. In my example below this is a filter, but it could be a function, the result of some user interaction, etc.

    variable setup for updating filter

    Conceptually, what's happening here is:

    1. The Filter widget takes (BLUE) Object Set as its input and returns a (YELLOW) Filter Output.
    2. (YELLOW) Filter Output is used to construct a new (GREEN) Object Set.
    3. (GREEN) Object Set is used as input to the dropdown.
    4. (RED) selected object in the dropdown will update whenever the (GREEN) object set updates.

    example of the selected item updating