Skip to main content

Survey Management Workflow

This document outlines the process for adding and updating surveys using the provided automation script.

Adding a New Survey

To add a new survey, use the add-survey.js script from the decision-pulse-survey-app directory. This script will automatically:

  1. Generate a unique ID for the new survey.
  2. Add the survey definition to src/survey-definitions.json.
  3. Commit the changes to the current branch.
  4. Push the changes to the remote repository, triggering a new deployment.

Usage

From the decision-pulse-survey-app directory, run the following command:

node add-survey.js "<title>" "<description>" '<questions_json>' "<optional_fields_text>"

Arguments

  • <title>: The title of the survey.
  • <description>: A brief description of the survey.
  • <questions_json>: A JSON string representing the survey questions. This must be a valid JSON array.
  • <optional_fields_text>: The text to display in the optional fields section.

Example

node add-survey.js "Q1 2026 Team Morale Survey" "A quick check-in on team morale for the first quarter." '[{"id":"q1","label":"How are you feeling about your work-life balance?","left":"Struggling","right":"Thriving"}]' "Your feedback is anonymous and helps us improve."