Learn how to embed subsets of your reports via queries
This feature is in beta and may change
Many times, your report will have different blocks, but you may wish to share only a subset, for instance it's often useful to embed a specific chart or dataset into another platform - especially if you are refreshing it on a cadence.
Instead of creating a report for each block, Datapane provides an block_name query parameter you can add to your report link that allows you to query your report, so you can embed only the relevant blocks.
Here are a few of the most common examples and use-cases you will encounter.
Querying by Block name
The easiest way to embed only a single block is to assign a name to your block when creating it, e.g. dp.Plot(plot, name="my-plot"), and then add a query param to your embed URL as follows:
As mentioned, Reports are comprised of multiple block types, such as Plot, Table, Text, and so on - we can select just blocks of a specific type using XPath, and even select the specific index of a particular block type or a range.
Let's say there are both Table and Plot blocks in your report, and you want to only embed the plots from your report. Simply add /?blocksquery=//Plot at the end of the report link. For example, to extract all the plots in this report you can use the following query,