How to figure out field-type of a reference/column in a data-collection(database)?

How can i get the “field-type” of a column in my database by code?

I know the command …

(typeof myElementHere)

… but how i do it in this case?

For example i have a column with contains Numbers and a second column which contains strings.
And i want to know, the type of both columns.

Are you thinking of type as in here.$w.Element.html#type
Get the element’s type

let myType = $w("#myElement").type; // "$w.Type"

To get the dataset field type you can’t do that through code, only through the dataset itself.

I know you are referring to as shown here.

What you are wanting is something like this with the columns in a table, however to be able to get it from a dataset instead.

If you could access the schema of the actual dataset then you could probably get the field type.

You can see more about schema and structure here,

Big thanks! I will study it for a while. :sweat_smile:

Ok, GOS i think i have understand it.
You mean, i have to make it through detours?

I have constructed some code, if i understand you right, it is the only way to do it over dataset + tables right?

A way over “datasets” direktly is not possible, or even “data-collections” right?

function xxx (parameter) {  
 let cols = $w("#table1").columns;

 let firstColID = cols[ZÄHLER].id;                   // "col0"
 let firstColDataPath = cols[ZÄHLER].dataPath;       // "first_col"
 let firstColLabel = cols[ZÄHLER].label;             // "First Column"
 let firstColWidth = cols[ZÄHLER].width;             // 100
 let firstColVisible = cols[ZÄHLER].visible;         // true
 let firstColType = cols[ZÄHLER].type;               // "string"
 let firstColPath = cols[ZÄHLER].linkPath;           // "link-field-or-property"

    console.log("firstColID = " + firstColID)
    console.log("firstColDataPath = " + firstColDataPath)
    console.log("firstColLabel = " + firstColLabel)
    console.log("firstColWidth = " + firstColWidth)
    console.log("firstColVisible = " + firstColVisible)
    console.log("firstColType = " + firstColType)
    console.log("firstColPath = " + firstColPath)

export function BTNprevious_click(event) {ZÄHLER = ZÄHLER-1}
export function BTNnext_click(event) {ZÄHLER = ZÄHLER+1}
export function button1_click(event) {xxx()}