Question T20075
Visible to All Users

how to send filtered form json in analytics

created 3 months ago

Hi,
i have created a form which contains 10 questions. Now the data is coming for 5 questions so, i want to show analytics for only 5 questions.
Is this possible? If yes, please suggest the ways to achieve it.

Answers approved by surveyjs Support

created 3 months ago (modified 3 months ago)

Hi Shobhit,
From what I gather, you wish to visualize only those questions which have values. To hide charts with no answers, set the IVisualizationPanelOptions.hideEmptyAnswers property to true.

JavaScript
import { VisualizationPanel } from "survey-analytics"; const vizPanelOptions = { hideEmptyAnswers: true }; const vizPanel = new VisualizationPanel( surveyQuestions, surveyResults, vizPanelOptions );

Let me know if it works for you.


For the record: a VisualizationPanel constructor accepts an array of question to visualize. If you wish to visualize only certain questions from your questionnaire, you can exclude them from the array of questions to visualize.

JavaScript
const surveyQuestions = survey.getAllQuestions(); // Visualize all questions // Exclude unnecessary questions from the questionsToVisualize array const vizPanel = new SurveyAnalytics.VisualizationPanel( surveyQuestions dataFromServer );

Thanks

    Show previous comments (5)

      Hello Shobhit,
      Do you want to exclude a Multiple Textboxes from the visualization? If so, the code I shared earlier successfully does it: View Plunker. Or, do you have difficulties visualizing Multiple Textboxes answers in a dashboard? Please elaborate.

      Thank you

        Hi Jane,
        I am having difficulties visualizing Multiple Textboxes answers in a dashboard.

          Hello,
          Thank you for the clarification. To process this inquiry in the most efficient manner, I created a separate ticket on your behalf: T20329: Multiple Textboxes question is not visualized. We placed it in our processing queue and will process it shortly.