Is it possible to programmatically select "Color By" field in ParaView Glance?

I have made stand alone “views” with Glance importing vtp data using Glance.importBase64Dataset. I would like to programmatically select the first data field (lets say labeled “A”), instead of glance opening with empty data.

If I understand correctly this can be done using the .glance state files. However, as they are binary I can’t really create them before. So I wonder can I somehow just maybe use a simple javascript snippet (after glance has loaded and initialized) to programmatically get the “color by” drop down menu and change the selection?

FYI, the glance state file is actually a zip file containing a JSON state. You should be able to assign a default colorBy that way. Saving a glance file with your desired colorBy state should give you an idea of what to modify.