Getting a list of folders and dashboards from the datasource plugin

I’d like to display in my Grafana panel a list of folder and dashboards.
Do I need to use the grafana API, or is there a way I can access this data from a data source ?

Hello @ilibilibom,

It may work for you:

import { getBackendSrv } from '@grafana/runtime';

const params: any = {dashboardId: ...YOUR_FILTERS}

getBackendSrv().get('/api/search', params).then(result => {
  window.console.log(result);
}); 

API query params docs: https://grafana.com/docs/grafana/latest/http_api/folder_dashboard_search/

Regards,
V.

Thanks so much @vsergeyev
This worked for me :slight_smile:

@vsergeyev
What was missing for was the part of getting data from the remote server.
this:
import { getBackendSrv } from '@grafana/runtime'
and this:
getBackendSrv().get
for plugins - in my case in react.
I think i might be good to add it some where in the docs.