Community Health Toolkit

Report Data Types for User Defined Form Fields

When creating a form the user can define what type of question it is. Is there anyway to control the outputting data type in the report or is a string always going to be the result?

I mean, everything gets serialized to a String when it is converted to JSON and stored back in Couch right?

I am not sure if this really answers your question, but I can say that under the hood Enketo tracks the data type associated with answers provided to each question (and widgets can control the data-type that they produce).

Also, I have seen a number of forms where calculate fields were used to massage data into a new value before storing it.

I think that answers the question.