Add string from other query to alert message


I would like to display the text from another database query in an alert message. Both the trigger and the text come from an Influxdb database.

The query for the trigger works:

The query for the text looks like this:

from(bucket: "machines")
  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
  |> filter(fn: (r) => r["_measurement"] == "ALARMS")
  |> filter(fn: (r) => r["_field"] == "Message")
  |> filter(fn: (r) => r["machine"] == "CLX450TC")
  |> filter(fn: (r) => r._value != "")
  |> last()

and returns e.g. the following text:

2023-06-02T11:50:07.067Z,51_700155,M: Spanner 4: Stellung undefiniert

I have added the query of the text in the alarm message, however, afterwards the alarm as a whole does not work - status NoData.

Is there any way to implement my plan? Opensource version 9.5.2 and the integrated alerting function are used.

Sad that it is apparently not possible. In the end I set up webhook and added the data using a python script and sent the message via Telegram bot.