@Tristan1 here is a example using scripts: see:
and here is a full function ready to be dropped into place:
You just need to change the getResource from the camunda db into your db call