10 - Using Your Function in a Workshop Module

This content is also available at learn.palantir.com ↗ and is presented here for accessibility purposes.

📖 Task Introduction

Once your semantically tagged function has successfully passed CI checks, it is ready for use in your Workshop module. In this task, you’ll configure a metric card to display the desired statistic.

🔨 Task Instructions

  1. In a new browser tab, open your flight alert Workshop module in Edit mode.

  2. Select your Metric card: Avg Risk Score from the layouts panel.

  3. In the metric card configuration on the right side of your screen, click the ⊕ Add metric button and then click into the Metric 2 block.

  4. Set the first few values as follows:

    • Label: Unresolved Alerts
    • Description: Percent of unresolved filtered flight alerts
    • Value Type: Number
  5. Click into the Select numeric variable . . . field, choose ➕ New numeric variable, and then Function.

  6. In the variable configuration window, rename the numeric variable from the default to [n] Percent Unresolved.

  7. Search for and select your Function in the Select a function . . . dropdown list. Check the name of your function in the code if you’ve forgotten it.

  8. You need to define an array of flight alerts as the required Function inputs. In the Function inputs section, under Alerts, choose [o] Filtered Flight Alerts as the input variable. This will ensure the metric updates with any filters your users may select from the filter list.

  9. Back on the widget configuration panel on the right, switch the Numeric Formatting toggle to the “On” position.

  10. Change the Base type from Standard to Percentage.

  11. Save and publish your module, then enter View mode to see your changes. Try adding a few filters to see how the new metric responds.