Skip to content

Survey responses open-data export#15492

Merged
alecslupu merged 10 commits intodevelopfrom
feature/open-data-export-surveys-2
Nov 18, 2025
Merged

Survey responses open-data export#15492
alecslupu merged 10 commits intodevelopfrom
feature/open-data-export-surveys-2

Conversation

@greenwoodt
Copy link
Copy Markdown
Member

@greenwoodt greenwoodt commented Nov 12, 2025

🎩 What? Why?

This makes the available the publication of survey responses through Open Data exports.

Exports published would only before from being included in the Open Data export thanks to a new component created within Surveys.

📌 Related Issues

Testing

(Before testing make sure you have responses available via seeds in a survey component via any space)

  1. Head to a Decidim application
  2. Head to a space with a Survey component active (make sure that survey has responses)
  3. Head to the settings tab and make sure "Allow responses" button is unticked.
  4. Head back to responses and press the "Publish responses" button
  5. Click a response to a question and make it publish it
  6. Head back to the front end home page of the application
  7. Scroll down to the footer and click "Open Data"
  8. See "published_survey_user_responses" link
  9. Click it
  10. See export working with the published responses you set in the admin.

(Click the export button again, if you get an export Open Data job error first time)

Further Testing

Since the Open Data job in development caches each export, publishing more responses won't change the contents of the export.

Head back to the admin where you have responses in the survey component you're testing and set to publish one more set. Kill the server and run the rails console with the following commands:

Decidim::Organization.first.open_data_files.each(&:purge)

followed by

Decidim::OpenDataJob.perform_now(Decidim::Organization.first)

If successful, will purge any open-data files cached and perform any pending open-data jobs.

Close the rails console then run the server (bin/dev). Go to the footer and repeat steps 6, 7, 8 and 9. See the CSV export with new publications of responses (or unpublished if you performed that action).

📷 Screenshots

Export in footer:
Screenshot 2025-11-05 at 14 11 01

Published responses (eg first set: "Soluta voluptatem quis. Accusamus consequatur numquam. Quisquam sapiente quos."):

image

Export CSV:

image

♥️ Thank you!

github-actions[bot]
github-actions bot previously approved these changes Nov 12, 2025
@greenwoodt greenwoodt marked this pull request as draft November 12, 2025 08:57
@greenwoodt greenwoodt changed the title Surveys open-data export Survey responses open-data export Nov 12, 2025
@greenwoodt greenwoodt marked this pull request as ready for review November 13, 2025 12:13
github-actions[bot]
github-actions bot previously approved these changes Nov 13, 2025
@greenwoodt
Copy link
Copy Markdown
Member Author

@andreslucena and @alecslupu this is now ready to review.

@greenwoodt greenwoodt moved this to 👀 In review in Maintainers' backlog Nov 14, 2025
@greenwoodt greenwoodt requested a review from a team November 14, 2025 07:44
@alecslupu alecslupu self-assigned this Nov 14, 2025
Copy link
Copy Markdown
Contributor

@alecslupu alecslupu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost perfect. Some I18n things and we are good to go.

github-actions[bot]
github-actions bot previously approved these changes Nov 18, 2025
@greenwoodt greenwoodt requested a review from alecslupu November 18, 2025 09:45
Copy link
Copy Markdown
Contributor

@alecslupu alecslupu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would expect something like this

Co-authored-by: Alexandru Emil Lupu <contact@alecslupu.ro>
github-actions[bot]
github-actions bot previously approved these changes Nov 18, 2025
@greenwoodt greenwoodt requested a review from alecslupu November 18, 2025 10:50
Co-authored-by: Alexandru Emil Lupu <contact@alecslupu.ro>
Copy link
Copy Markdown
Contributor

@alecslupu alecslupu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Merging with codecov failure.

@alecslupu alecslupu merged commit f57ce9f into develop Nov 18, 2025
26 of 27 checks passed
@alecslupu alecslupu deleted the feature/open-data-export-surveys-2 branch November 18, 2025 12:57
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in Maintainers' backlog Nov 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

No open projects
Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

Publish survey public's answers on Open Data files

2 participants