Can I include results from datasource queries inside Text panel in html mode?

Hi, I would like to take advantage of html in Text Panels and be able to customize its layout so I could make a panel showing formatted text and and some metric fields with counts of alerts per category.
Is it possible to use the html in the text panel and some kind of script to query a data source, or include a singlestat panel inside of it ?

Hi brunofl. I’ve just started investigating this - have you had any success?