Alerting: Unable to send the whole query data in notification message

There is a scenario where I want to dump all the user_ids (for example) which come from the execution of query or some other column, to be sent as part of the notification alert message. But I am not able to get that. Can somebody help on how this can be achieved?
I am only getting the count currently, as the “WHEN condition” in alert panel is count()