In Flattening an object with dot syntax I showed how to take a an object of more than 1 level deep and flatten it so it could be represented in a two dimensional object like a spreadsheet. Now here’s the opposite, unflattening an object created that way. I also provide a library you can use for flattening and unflattening, as well as processing objects to and from spreadsheets

Here’s the library reference

 MqxKdBrlw18FDd-X5zQLd7yz3TLx7pV4j 
Consider this object,
which has been flattened from this original object
Note how an array is handled using the index number as a part of the flattened property

Here’s how to use.
flatten an object
result

unflatten an object

result

create spreadsheet representation of values from an object

result

create an unflattened object from spreadsheet values

result

Putting it all together, start with an object, write it to a sheet

result

a b c.d c.e.f g.0 g.1 g.2
1 2 3 25 1 2
3 2 2 5 11 12 13

create an unflattened object from a sheet

result

The code

Here’s the library reference
MqxKdBrlw18FDd-X5zQLd7yz3TLx7pV4j
For more snippets topics, see: