This is likely an inexperienced query writer (me). I run Data Explorer query to report all users who have entered some text in a custom field (we ask for their Fediverse username):
SELECT ucf.user_id,
ucf.value,
ucf.updated_at AS reltime$time
FROM user_custom_fields ucf
WHERE ucf.name = 'user_field_9'
AND LENGTH(ucf.value) > 1
ORDER BY ucf.updated_at DESC
It works great, I get results that show the discourse usernames and their entries:
However when I export, I get a user_id in the first column, where I really want their username
(I can see that’s what my query asks for). I am guessing the conversion fro user ID to username is built into discourse? How can I get the username in both the Explorer view and in the CSV exports?