Your object looks like this
but you need it to look like this
First - we need to flatten it, so we get this
and we also need to join the resultant keys with dots.
and finally, put it all together to make a new object with the flattened keys
See Database abstraction with google apps script and Google Apps Scripts snippets for more like this
For help and more information join our forum, follow the blog, follow me on twitter
Services > Desktop Liberation - the definitive resource for Google Apps Script and Microsoft Office automation > Google Apps Scripts snippets >