

Extracting fields from JSON
You can see the alert payload for all the alerts you’ve received. Write your query in the step Then extract fields from JSON. By default, use$ to reference the payload, then access fields like $.field, or $.items[0].name.
For logic the $ syntax can’t express, such as filtering or reshaping an array, use the </> toggle on the field to switch to JavaScript.
JavaScript here supports ES6, including arrow functions, template literals,
let and const, destructuring and classes, and newer methods such as includes, padStart, Object.entries and flatMap.Some newer syntax isn’t supported, including optional chaining (?.), nullish coalescing (??), object spread ({ ...obj }), async functions and Map or Set. Use && and || to handle missing fields instead.
Options to extract values from the payload
1. Extract a simple field
If you click on any field displayed in the payload, you’ll automatically see this value extracted. For example, to extract theservice field from your metadata, use
service field and apply it to your alert.
2. Map array fields
To map an array field, switch the field to JavaScript with the</> toggle.
In our JSON payload, our tags field has the following format:
