How to get the query Id from looker?
Hi
You can use system activity or /admin/queries when the query is run and look at the details section. It will also appear to the right of the source column on the main page of /admin/queries when run. Or you can get the slug in the url of the query and use the query_for_slug endpoint.
q = sdk.query(query_id=ID)
print(q.fields)
q2 = sdk.query_for_slug(slug="SLUG")
print(q2.fields)
An example system activity query would look like this:
HOSTNAME/explore/system__activity/history?fields=query.id,query.link,query.model,query.slug,user.email,user.id,query.formatted_fields&sorts=query.id&limit=500&query_timezone=UTC&vis=%7B%7D&filter_config=%7B%7D&origin=share-expanded
Please let me know if you have any questions.
Thanks,
Eric
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.