Use a variable column name to perform operation

I’ve a code which needs to be robust to variable column name.
I’ve tried the following which fails

var = mapwindow(cell -> mean(map(x -> columnnames(x)[findfirst(map(c -> startswith(string(c), "var_ "), columnnames(cell)))], cell)...), content, 1)

Previously, it was working with something like
# var = mapwindow(cell -> mean(map(x -> x.var_8, cell)...), content, 1)
so the column name in variable content can be anything like

x.var_8, x.var_16, x.var_3 etc

What is x? Where is columnnames defined?

Its from Types Tables