8 - Testing your custom aggregation Function

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

📖 Task Introduction

Use the Live Preview feature to test the function you just inserted into your code editor.

🔨 Task Instructions

  1. Ensure your Code Assist is running and select the fx Functions tab in the helper toolbar along the bottom of your screen. Then, open the Live preview tab of the functions helper.

  2. If your code is error-free, you’ll see your named Function in the list. Click on it to reveal the test UI on the right.

    • If your Function name isn’t showing up in the list, ensure your code is not presenting any errors. Otherwise, restart Code Assist and/or refresh your browser.
  3. Select the Alerts search field and choose Select all 30. This will provide a sample array of 30 of your flight alert object into the function and return the output.

  4. Select Run ▶ to test the function.

  5. Look below Run ▶ to view the results of your test. Your result should be 0.366 recurring - indicating that 36.6% of the 30 alerts are unresolved. Remember that you are dividing the number of results by the length of the provided array of alerts; a value of 1 means every alert in the array met the criteria in your for loop.