Hi I’m building a custom visualization where we need to make an additional query based on the data passed in. The generic flow looks like this:
- Pass the queried dataset into the visualization.
- Visualization looks at the first row and gets an id (it will be unique for the dataset).
- Visualization makes another query to get potentially large amount of metadata associated with that id.
- Use the associated metadata to render the data.
In our specific case our “dataset” is a set of locations which have x/y coordinates, and our “metadata” is a large png image file that they will be rendered on top of. The image file is dynamic so we can’t use built in looker mapping tools.
In our case, we have a couple of different ways to query the data, either through an API call to our server APIs or by making an additional query to looker. Our APIs are authentication, and I’m not sure how to get the looker visualization authenticated. The ideal option, I think, would be to be able to make a subsequent query to the data store asking for this data, but I’m not sure how to do that. Has anyone done something like this before?
Ahh, I just stumbled across this older post discussing something similar.
It looks like we can use this API feature from the visualization `run_inline_query()`: