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 => {

API query params docs:


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

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