0

My app in Google Apps Script gets data from a form that I want to process. The element form is received and contains the different parameters and values.

If I log the element form it looks like {uid=11, tradingname=xxx, email=yyy}

I can pick up the separate values by running form.uid or form.tradingname for example. But what I want is to pick up the parameters from the element form by referring to a String "uid" (because I get this value form the headers row of the spreadsheet).

Is there a simple way I can do this in one line, for example something like:

form.element["uid"]

So far I've only found difficult methods like https://gomakethings.com/how-to-get-the-value-of-a-querystring-with-native-javascript/ and I would think that I should be able to do this in an easier way.

Thanks!

Chris Rutte
  • 173
  • 1
  • 14

1 Answers1

0

You can use $("#yourform").serializeArray() and then iterate to match "name" values you want

Lexahen
  • 15
  • 4