welcome to the
community @baileyheit1!
This is a really common question and I’m still learning how to access the values out of the alert query too. I hope this is a helpful example - I tried to make it very detailed for the benefit of other community users, even though I can tell you already know how to do some of these steps 
With an alert query that looks like this - I created this with our sample TestDataDB datasource and manually added some labels that are similar to the ones you mentioned.
Click on the preview alert button to see the labels and values in the map:
To refer to labels and values from the query add a new annotation to the alert like this. Name the annotation AlertValues
{{ with $values }}
{{ range $k, $v := . }}
Location: {{$v.Labels.location}}
Variable: {{$v.Labels.variable}}
Alerting value: {{ $v }}
{{ end }}
{{ end }}
Here it is in the context of the alert definition:
Then you can add a message template called myalert to create a single alert message and print the annotation. Notice that you will reference the annotation by name (.Annotations.AlertValues
) in the sample below:
{{ define "myalert" }}
[{{.Status}}] {{ .Labels.alertname }}
{{ .Annotations.AlertValues }}
{{ end }}
Here it is in context of the UI:
Next, you can add a message template for the full message, I called this one mymessage. Notice how the mymessage template references the myalert template that I created in the last step:
{{ define "mymessage" }}
{{ if gt (len .Alerts.Firing) 0 }}
{{ len .Alerts.Firing }} firing:
{{ range .Alerts.Firing }} {{ template "myalert" .}} {{ end }}
{{ end }}
{{ if gt (len .Alerts.Resolved) 0 }}
{{ len .Alerts.Resolved }} resolved:
{{ range .Alerts.Resolved }} {{ template "myalert" .}} {{ end }}
{{ end }}
{{ end }}
Lastly, you can add the mymessage template to the body of your slack contact point under Optional Slack Settings:
Alert summary:
{{ template "mymessage" . }}
In the UI, it looks like this:

Now you should have an alert to your slack contact point that looks something like this:
A side note related to using Alert.Labels . . .
Something that can get confusing is that .Labels
mentioned in the Template Data docs refer to the labels attached to the alert object NOT the query response labels. For those, we need to get into the values
map in the exercise above: