---
title: "Unnest an object with array values using cartesian product [for Google Apps Script POST/GET web apps]"
author: "Martin Hawksey"
date: 2022-04-19T09:10:47+00:00
modified: 2022-04-19T09:12:24+00:00
canonical_url: https://pulse.appsscript.info/p/2022/04/unnest-an-object-with-array-values-using-cartesian-product-for-google-apps-script-post-get-web-apps/
markdown_url: https://pulse.appsscript.info/p/2022/04/unnest-an-object-with-array-values-using-cartesian-product-for-google-apps-script-post-get-web-apps.md
categories:
  - "Intermediate"
  - "Solutions"
  - "V8"
  - "Web App"
tags:
  - "@choraria"
  - "script.gs"
featured_image: https://pulse.appsscript.info/files/2022/04/unnest-object-with-array-values.jpeg
description: "Sourabh Choraria has hit a rich patch of Google Apps Script exploration and following the post we shared recently on Google Sheets cell precedents in this latest post Sourabh looks at restructuring data into a cartesian product. The post contains some nice other 'Easter Eggs', in particular, worth checking out Sourabh's latest Workspace Add-on, Webhooks for Sheets, and a snippet of code on GitHub used in the add-on for handling GET and POST requests."
---

# Unnest an object with array values using cartesian product [for Google Apps Script POST/GET web apps]

![Unnest an object with array values using cartesian product [for Google Apps Script POST/GET web apps]](https://pulse.appsscript.info/files/2022/04/unnest-object-with-array-values.jpeg)

> [https://script.gs/unnest-an-object-with-array-values-using-cartesian-product/](https://script.gs/unnest-an-object-with-array-values-using-cartesian-product/)
> Convert array values from the doGet & doPost event parameters into 2D array when writing them onto a Google Sheet.

Sourabh Choraria has hit a rich patch of Google Apps Script exploration and following the [post we shared recently on Google Sheets cell precedents](https://pulse.appsscript.info/p/2022/04/find-precedents-of-cells-with-formulas-in-google-sheets-using-apps-script-part-1/) in this latest post Sourabh looks at restructuring data into a cartesian product. The post contains some nice other ‘Easter Eggs’, in particular, worth checking out Sourabh’s latest Workspace Add-on, Webhooks for Sheets, and a snippet of code on GitHub used in the add-on for handling GET and POST requests.

Source: *[Unnest an object with array values using cartesian product*](https://script.gs/unnest-an-object-with-array-values-using-cartesian-product/)

---

*Published by [Martin Hawksey](https://pulse.appsscript.info/p/author/admin/) on [Pulse](https://pulse.appsscript.info/). Original article: [https://pulse.appsscript.info/p/2022/04/unnest-an-object-with-array-values-using-cartesian-product-for-google-apps-script-post-get-web-apps/](https://pulse.appsscript.info/p/2022/04/unnest-an-object-with-array-values-using-cartesian-product-for-google-apps-script-post-get-web-apps/)*
