Question T4452
Visible to All Users

Decimal Input Type

created 5 years ago

Hello,

I am researching SurveyJS with a view to purchase a licence shortly for a client application.

Without the need to have a custom widget, my client wants to capture different input types (e.g. text, number, dates). However, I cannot see how to capture decimal or monetary values without knowing what the input type is, as the issue I have is that result JSON only returns the value so my client is unaware how to process the data by type.

Is is it easy to map the result JSON back to the question JSON to get the result question type?

Thank you in advance.
Chris

Answers approved by surveyjs Support

created 5 years ago

Hello Chris,
The survey result JSON is basically a dictionary that contains the information about question name (to be more precise question.valueName and if it is empty then question.name) and it's value. You can always modify your survey results. There is an example in the documentation that shows how to do it. You can modify it by adding this code instead of copying "tag" property:

JavaScript
//If the custom property tag is defined set if(question.inputType !== undefined) { item.inputType = question.inputType; }

Thank you,
Andrew
SurveyJS Team