Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get the results as proper JSON? #8

Open
flowt-au opened this issue Dec 4, 2018 · 4 comments
Open

How to get the results as proper JSON? #8

flowt-au opened this issue Dec 4, 2018 · 4 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@flowt-au
Copy link

flowt-au commented Dec 4, 2018

My WP survey has dynamic panels which I am going to need to "flatten" in order to make a sensible report. First step is to get the JSON of all results.

If I click the Copy button I do not get JSON. I get a mixture of text and json as below (is an abbreviated version of data from the test survey results). Any way to get clean JSON? Am I missing something.

‹ Kindlehill School, Blue Mountains — WordPress

question9 question6 For this student ... To what extent is the school meeting your expectations of your child/young person’s education What are your thoughts about the volunteer work you do at the school? Are you intending to send your child to Kindlehill High School? Whatever your response above, please expand on your thinking about High School. How would you rate your expectation of administration in terms of: Do you read? What does Kindlehill do well?
Test 1 Show in Survey
[{"question2":{"Row 1":"Column 2"},"question3":{"Row 1":"Column 1"}},{},{}] {"0":{"Column 2":"1","improvements":"ghjk ghjkghkjg"},"To what extent do you value the balance of thinking, feeling, doing (willing) in your child/young person’s education?":{"Column 3":"1","improvements":"bhj "}}

{snip....}

} {"Kindlings":"Sometimes","Fortnightly newsletter via email":"Always"} all Show in Survey

Thanks,
Murray

@tsv2013
Copy link
Member

tsv2013 commented Dec 4, 2018

It's easy to get full survey results (name, displayName, value, displayValue, data) programmatically:
survey.getPlainData();

How to show flat survey in read only mode is demonstrated here - https://surveyjs.io/Examples/Library/?id=survey-displaymode&platform=jQuery&theme=default

You can use also the isSinglePage option.

But I'm not sure I understand your scenario.

@flowt-au
Copy link
Author

flowt-au commented Dec 4, 2018

Thanks! My question relates to this surveyjs-wordpress plugin, not surveyJS in general.

I was looking for the "export" button to get the result data as JSON directly from the WP interface. Or, even better, a button that runs the survey.getPlainData() on all the data and returns that.

At present, when you export to Excel or CSV matrix data is saved as JSON within an Excel cell which doesn't really help when it comes to reporting.

screen shot 2018-12-05 at 10 16 08 am

Ideally the Excel export should flatten the data automatically. As a fallback, getting the data as a "flat" JSON array means I can then use one of the JSON to excel converters. Better if surveyjs did that automatically though.

Thanks again,
Murray

@tsv2013 tsv2013 added enhancement New feature or request question Further information is requested labels Dec 5, 2018
@tsv2013
Copy link
Member

tsv2013 commented Dec 5, 2018

Thank you, @flowt-au . I see now. I've marked this issue as an enchancement. This enchancement of the surveyjs-wordpress plugin (and surveyjs.io service site as well) makes sence. We'll definitely implement it. But I can't promise any timeline because we have a lot of tasks related to library and builder.

@flowt-au
Copy link
Author

flowt-au commented Dec 5, 2018

Cool. Thanks. I have stopped using the plugin because of this issue (and the others). Instead I have reverted to my own hosted version of SurveyJS and use an iframe in the WP site page to deliver it. Not ideal, but good enough for this project.

Thanks again,
Murray

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants