Programmatically change a Grid Product Galleries category

I want to change the Category that a Store Grid Product Gallery uses dynamically. Is there a way to do this? In image below, you’ll see that the category can be selected manually in editor. I want to change this dynamically when the page loads via JavaScript $w. based some other data I have…