BLO: subcribe histdata

Hello Rapid m2m community,

is there an example code of how to subscribe to the hist data in the BLO?
An example of a subscription to the sites is listed in the help, but I don’t get it adapted for the hist channels.

Best regards,

below a sample how to subscribe to histdata0

BAPI.subscribe('histdata0', { select: ['val1_avg', 'val1_max'] })
	.onUpdate(async (data, context) => {

	.onDelete(async _uid => {
	    //onDelete is called when a site was removed
	.onInitialized(async () => {


Kind regards,

Hi Jakob,

thank you very much!
The designation of the individual variables of the hist channel (‘val1_avg’, ‘val1_max’) did not matched in my code.
It works now.

Best regards,