Data type mismatch between SQL and Perspective table

Hello Forum.

I am trying to render the results of a SQL Query on a Perspective table. I authored a Named Query that returns a data set which includes a few “date” columns. Authoring shown below:

The results from the “Testing” tab show the columns returning in the correct format:

However, when I bind the data of my Perspective table to the named query, the columns are not returned as “date” type. I tried changing props.column[xx].render from “auto” to “date.” That didn’t work.

Any ideas why the fields aren’t rendering correctly?

Thanks,
M Murphy

You haven’t set the field property for the column, and so the settings will not have any noticeable effect. set Table.props.columns[7].field to “CAL_Due”.

That did the trick! I guess I had assumed that “Add Array Element…” would have tied it’s index to the columns on the table.

Thanks for the quick response!
M Murphy

1 Like

That's not safe to assume because there is every possibility that you actually want to re-order the columns based on some other information, or even omit some columns based on possible security restrictions for the user. From a default table placement with a data binding, when you add the first column element we default to showing... the first column - and this continues as you add each other column, but we don't apply any settings from the column object because you haven't actually specified which column the object defines.

It's a weird trade-off due to us not wanting to show no columns if you have column objects defined vs showing columns if you have NO columns defined.