

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.
Expressions here can use synchronous JavaScript up to ES2023, including arrow functions, template literals, destructuring, optional chaining (
?.), nullish coalescing (??), object spread ({ ...obj }) and newer methods such as Object.hasOwn, Object.groupBy and toSorted.async functions and Promises, generators, Symbol, Map and Set aren’t supported.
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:
