How to pass Query result into the Alert annotations- summary section

Hey Team,

I just want to check regarding the creation of an alert rule. It seems that in the ‘Define query and alert condition’ section, we can create a query with result of a maximum of 2 columns: the first column serves as an ID, and the second column is the data value for each ID.

image

In the ‘5. Add annotations’ section, I want to know if it is possible to input all IDs from the query into the summary. Currently, I can only pass a single value by writing {{$value.A}}. However, if I want to pass a list of ID from first column (for example, if the query after the WHERE statement return deviceID and its value of each issue device: id1:500, id22:300, id20:400, id66:500, I want to include a message like: “Below Device IDs have issues: (id1, id22, id20, id66)” in the summary), would that be possible? If it is not possible, would it be possible to pass the whole query result, with each row, into the summary section?
image

Thanks so much!