simon_tomes | 2024-02-14 16:41:06 UTC | #1 Is it possible to export topic post data to a csv file? I'd like to take a topic post and all of it's replies and turn it into a handy wiki (for example). I could copy and paste the replies and find a good way to group them. However, if it's easier to do an export of a topic and all replies I'd welcome the time saver. If not an option via csv, could this be done via the data explorer? I'd like to see the reply content along with the associated user who replied. ------------------------- merefield | 2024-02-14 15:53:37 UTC | #2 This might help, if not exactly what you ask, raw format: https://meta.discourse.org/raw//295350 ------------------------- Arkshine | 2024-02-14 15:56:59 UTC | #3 Yes, you can export the query result to a CSV file. You have a button for that action: ![image|690x315](upload://udCj1mIeZMTZWCrJPLLe7bZrAWU.png) I'm not entirely certain if this is precisely what you had in mind, but I can provide you with a starting point. You provide a topic ID and the post number you want to get all replies from: ```SQL -- [params] -- integer :topic_id -- integer :post_number SELECT u.id, u.username, p.raw, p.cooked FROM topics t JOIN posts p ON t.id = p.topic_id JOIN users u ON p.user_id = u.id WHERE t.id = :topic_id AND p.reply_to_post_number = :post_number AND p.hidden_at IS NULL AND p.deleted_at IS NULL ``` This looks like this: ![image|573x499](upload://MS2xVYF9s15o66txHSDFjhKila.png) ------------------------- simon_tomes | 2024-02-14 16:01:40 UTC | #4 Thanks for your advice, @merefield and @Arkshine. I shall explore and give some things a go. -------------------------