Hi guys.
Would there be a doc/tutorial for non-webdev on how to use data/queries/results in topics/posts? I searched but failed to find one. Thanks.
AI-generated summary
In a support thread titled âHowto/doc on âdata explorerââ, users seek guidance on using Discourseâs Data Explorer for querying and incorporating results into topics or managing groups. lejeczek asks for documentation on embedding query results into posts; Moin suggests existing SQL tutorials, but lejeczek clarifies theyâre seeking how to dynamically insert results into topic content. JammyDodger confirms this isnât currently possible, though automations can email or PM results. lejeczek references a post mentioning âmanually createdâ topics using query data, which pfaffman clarifies means copying and pasting results â not dynamic updates. IrisBetty asks how to use a query to create a new group and copy members, pasting SQL into the Data Explorer but seeing no input fields. pfaffman and [13] emphasize Data Explorer is read-only; modifying data requires the API or Rails console. IrisBetty realizes they may have confused exporting user lists for manual upload, but pfaffman notes bulk group addition via upload isnât straightforward â likely requiring invites. IrisBetty links to a relevant topic but concludes invites wonât suffice for their use case. The thread underscores Data Explorerâs role for data analysis only, not modification, and suggests alternatives like API or admin intervention for group management.
Did you find
Maybe the other topics with sql-tutorial help you too.
Thanks. Iâve thumbed through it - perhaps Iâve gone blind - but cannot see bits which would mention âincorporatingâ queries/results into a topic/post, into its content.
I donât believe this is currently something you can do. There is an Automation that will send results to a PM or email. Perhaps you could check that out and see how it does it?
How people do it then or how to understand when someone says â.. manually created a new topic using the data from the Published Pages query above, then published it at `/pub/index..â ?
That is a quote from another topic about âindexing published pagesâ
Copy and paste?
âmanually createdâ for means that they created the topic normally and pasted in the stuff from the data explorer.
It might help if you say more about the specific problem that you are actually trying to solve.
Oh. I presumed that - since it looked like a âhotâ topic to me - that proposed idea was a solution to have a dynamic index of published pages. I thought that was the idea behind it - to have TOC/index for published pages, dynamic index.
I am stuck. Iâm trying to use the query to. create a new group and copy all existing members into that group.
I understand the part of getting to data explorer, naming it etc.
Iâve copied the query - now where to do I paste it? Iâve pasted it to the text box to the right of the Select area but nothing happens.
sorry for the elementary question but Iâm on a time crunch to get this done.
tx
Bronwyn
Data explorer is only for exploring data, not changing it.
If you need to change something with code, and donât have access to run stuff in rails, then you need to use the API.
What problem is this solving? Do you really want to create a new group that has every user on the system on it? You canât use @everyone or @tl0?
Hi Jay:
There is a post on running a query that copies all users from certain groups into a new group.
I wasnât to copy from the current Everyone into a new group.
Going forward, some of the Everyone group wonât be in the new group.
I found the post that showed this query:
â[params]
â string_list :group_name
â string_list :new_group_names
SELECT ue.email as âaddress@emailâ, :new_group_names as ânew groupâ
FROM users u
INNER JOIN group_users gu ON u.id = gu.user_id
INNER JOIN groups g on g.id = gu.group_id
INNER JOIN user_emails ue on u.id = ue.user_id
WHERE g.name IN (:group_name)
AND ue.primary = true
I pasted that into the box to the right of the SELECT item. It said that two new input fields should appear at the bottom. But they havenât.
Wondering what I have done wrong.
Bron
You cannot change data with the data explorer plugin. I promise.
Youâll need to use the API (which will be hard unless you donât have many users) or get the folks that are hosting you to do it from Rails.
Got it, thanks. I thought I used the data explorer to get the list and then I used that to upload to the group. I must have misunderstood. thanks for your quick advice. Iâll wait for Richard O to do it for me. Born
OH! I missed that part. But I donât know if thereâs a way to upload a list for a group, except as an invite?
But if it doesnât actually add them but sends an invitation then it is of no use and I think you are probably correct.
thanks again Jay.