# Query 'Preview' not working in SQL badge page

**URL:** https://meta.discourse.org/t/query-preview-not-working-in-sql-badge-page/276765
**Category:** Bug
**Tags:** badges
**Created:** [August 25, 2023, 5:17am UTC](https://meta.discourse.org/t/query-preview-not-working-in-sql-badge-page/276765 "2023-08-25T05:17:06Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [August 25, 2023, 5:17am UTC](https://meta.discourse.org/t/query-preview-not-working-in-sql-badge-page/276765/1 "2023-08-25T05:17:06Z")

</div>

> [@Badge for posts with Likes from a specific group](https://meta.discourse.org/t/badge-for-posts-with-likes-from-a-specific-group/276728/9):
>
> Weird 😵‍💫 It still doesn’t work for me. I’ll try running it against a few other groups to see if I can find the issue.
> 
> Edit: Ran against a different group, and the query still failed. I’m not sure what the issue here would be. Does it depend on primary groups by chance?
> 
> Edit 2: That wouldn’t work, `staff` doesn’t seem to be allowed to be set as a primary group.

Just to note, if you’re using the Preview I think it may not be working. I noticed some issues with it when building a badge recently.

---

<div class="post-metadata">

### Author: ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)
#### Post date: [August 25, 2023, 5:44am UTC](https://meta.discourse.org/t/query-preview-not-working-in-sql-badge-page/276765/2 "2023-08-25T05:44:09Z")

</div>

🤦🏻‍♀️

oh dear. Thanks for the update. I am having fun though! 😅

All my badge queries are failing in the previewer but working in [Data Explorer](https://meta.discourse.org/t/32566?silent=true). I’m sitting here looking at table schemas and going crosseyed 🙃

---

<div class="post-metadata">

### Author: ![Firepup650](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/firepup650/32/465200_2.png) [@Firepup650](https://meta.discourse.org/u/Firepup650)
#### Post date: [August 25, 2023, 10:57am UTC](https://meta.discourse.org/t/query-preview-not-working-in-sql-badge-page/276765/3 "2023-08-25T10:57:01Z")

</div>

Ah. That might be why then. I was running them on the preview. I felt like I was chasing a ghost bug somewhere 👻

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [August 25, 2023, 1:43pm UTC](https://meta.discourse.org/t/query-preview-not-working-in-sql-badge-page/276765/4 "2023-08-25T13:43:15Z")

</div>

> [@Badge for posts with Likes from a specific group](https://meta.discourse.org/t/badge-for-posts-with-likes-from-a-specific-group/276728/18):
>
> I am interested to work with her when I know the badge query previewer is working.

We do have a fix in the pipeline for that. 👍

> <https://github.com/discourse/discourse/pull/23269>
>
> \<img width="510" alt="Screenshot 2023-08-25 at 8 19 38 AM" src="https://github.c…om/discourse/discourse/assets/50783505/9ebf467e-7b3b-49e2-91d9-43e37b838431"\>

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [August 26, 2023, 1:25pm UTC](https://meta.discourse.org/t/query-preview-not-working-in-sql-badge-page/276765/5 "2023-08-26T13:25:45Z")

</div>


