Dynamic column header and repeat columns

I am using LitElement to create component with vaadin grid. I have an array of json objects and each json object has another sub-array of another json object ,say JSON2.What I am trying to achieve are :

  1. Have static columns for each property of main jdon object . This part works fine.
  2. Iterate the sub-array and create a column for each object . Also. I want set the column name for these columns from one of the properties of JSON2.

Any thoughts or ideas on this? Thanks for the help.