Tags are a useful way of filtering large numbers of queries or dashboards, but adding tags can only be done one at a time on each individual item. This makes the task of adding a new tag to a large number of items very tedious and time consuming.

It would be way more efficient if there was an action on the Queries list (for example) to add a tag (or tags) to multiple queries at once. The list of queries would need have a selection box to enable the user to select the target queries and then apply the selected tags.

2 Likes

+1 Would like to see this in the front-end.

Meanwhile, you can do this with the API. Just provide the query ID’s and the tags you want to apply.

import requests

redash_url = "Wherever Your Redash is hosted"
query_ids = [1, 2, 3, 4]
API_TOKEN = "token provided by Redash"
params = {'tags': ["your", "array", "of", "tags"] }

s = requests.Session()
s.headers.update({'Authorization': 'Key {}'.format(API_TOKEN)})

for query in query_ids:
  response = s.post('{}/api/queries/{}'.format(redash_url, query), json=params)
1 Like

Thanks for the API approach, that will be a useful work around. cheers.

1 Like