It is possible using looker API3 to retrieve sql query (text) that has been generated by tile(look) in dashboard?
I want to get field sql (like in sql_query method) but only forqueries that was already been run.
So basically having query_id I want query method to return sql query textas a field as well. Is it possible in any way?
Best answer by Eric_Lyons
You can do something like this:
from looker_sdk import methods, models40
sdk = looker_sdk.init40()
elements = sdk.dashboard_dashboard_elements(dashboard_id="970")
for element in elements:
query = sdk.run_query(element.query_id,result_format="sql")
One of the result formats for run query is sql.