Creating a custom property dataset using a temporary binding
There isn't a built-in method to create a dataset in a Perspective custom property. Creating an Expression Binding with this script will generate one. The binding can then be removed leaving the dataset.
Expression binding on custom property
unionAll(
asMap(
"someDate", "date",
"someBool", "B",
"someInt", "I",
"someString", "str"
),
asList() // No row data.
)
/* Returns
"#NAMES"
"someDate","someBool","someInt","someString"
"#TYPES"
"date","B","I","str"
"#ROWS","0"
*/
Features employed
- unionAll() Assembles an output dataset from scratch, using the given column names and types (internally via a
DatasetBuilder
), performing a UNION ALL with each row source. - asList() unconditionally assembles all of its arguments into a List.
You really only need to create one column with the binding and then modify the result with the Dataset Editor. (Click the icon to the right of the Dataset [...]
.)