If you are starting with a convential dataset (NQ or historian), it is best to bring that binding to a view custom property, keeping dataset format. Then you can bind props.data to convert the data to JSON, and simultaneously bind props.columns use the ordered column information (name and data type).
Some example code here, even if you don't use my toolkit: