Export from a table using snippet that uses table columns as export rows? Also only visible column

Thanks for this. This is precisely what I’m trying to do.

Just tried this but I can’t get it working. I entered my model name into the snippet at the top and otherwise just used the code you provided. There’s a typo “fieldNamess” in the code; I corrected that and the CSV downloaded, but there’s no columns or data in the CSV. Not sure where it’s going wrong. Any Ideas?