Community > Discussions
138 views
4 replies

Live Forms Post to Google Sheets - Need help to improve

Hi,

I found a way to post data from Live Forms to Google Sheets using this method: https://github.com/jamiewilson/form-to-google-sheets

I was able to get it to work by following steps 1-5, and then for step 6 I use the Http Post Action in Live Forms. The only problem is that this uses the INPUT NAME for each field and so the spreadsheet has to use columns named like this: "dnn$ctr5740$View$Textbox_5740_1" instead of something simple like name, email, phone, etc...

Does anyone know of a way to modify this script/method to make this work better to get a Google Sheet with column names that make sense for an end user? Or perhaps a completely different way to accomplish this?

Thanks!

Josiah Olhava Josiah Olhava
Published 10/15/2018 18:29
Add Comment
Josiah Olhava

Hi,

With the changes to Live Forms in the past year, posting submissions directly and automatically to Google Sheets works pretty well now. I am posting how I have done this successfully for the Mandeeps community in case anyone else wants to do this.

SETUP Google Sheets with Script

  • Follow steps 1-5 here: https://github.com/jamiewilson/form-to-google-sheets See the Readme.md below the files.
  • Do this for each form & sheet you want to create.
  • You could optionally have multiple forms go to the same sheet as long as the sheet has the necessary fields.
Live Forms Setup
  • Give any fields Custom Token Names as necessary - these Tokens must match column headers in the sheet.
  • Create an On Form Submission Action>Http>Http Post
  • Input the URL of the script from step 5 above - "Current Web App URL"
  • Add your Post Data
*Here is an example of Post Data from a form I setup:
Agree=[Agree:text]&Birthdate=[Birthdate]&City=[City]&Email=[Email]&First Name=[First Name]&Last Name=[Last Name]&Phone=[Phone]&Signature=https://mywebsite.com[Signature]&State=[State]&Street Address=[Street Address]&Zip=[Zip]&Created On=[DateTime:Now]&PDF=https://mywebsite.com[Form2PDF:link]
 
A few notes: 
  • As you can see in this example I am able to submit the URL's to Signatures and PDF's generated by adding the domain to the token. 
  • Live Forms doesn't seem to have a token for it's own CreatedOn field, so I used the DNN DateTime token.
  • The order does not mater.
  • You only need to send the fields you want.
I hope this helps someone! 
replied 01/28/2020 02:06
Josiah Olhava

I just realized that a few of my tokens were removed or converted in the Post Data example. I am re-writing it but using parenthesis () instead of brackets.

Agree=(Agree)
Created On=(DateTime:Now)
PDF=https://mywebsite.com(Form2PDF:link)
 

replied 01/28/2020 04:00
Mandeep Singh

Thanks for sharing this!

replied 01/30/2020 01:18
Mandeep Singh

Josiah,
You cannot change the auto generated field names in Live Forms. Unfortunately, I am unable to assist with modifying the script to work with Live Forms. 

If posting to Google Sheets is something you'd like to see supported in Live Forms then feel free to add your request in Community Ideas. Let us know if you're willing to sponsor the feature; otherwise, we'll add it to our roadmap based on community interest. Thanks

replied 10/15/2018 20:44

Last Activity 01/30/2020 01:18