How to create a dashboard metric widget to automatically obtain the data template?


Dear friends, I am using the dashboard metric widget to obtain data, but I have not found a way to reuse it, it cannot use functions. I can create a new project form through a template, but when I use the dashboard, I have to re-select the data source. To obtain data for a new project, is there any good method to suggest that we can automatically obtain it through a template instead of manually selecting the data?