Managing your business with anyPiece/WYSIWYG Web editor/Web designer or programmer/Work with google spreadsheet

From Wikibooks, open books for an open world
Jump to navigation Jump to search

Prerequisite[edit | edit source]

  • Please make sure your form have following field configure into your form
Field Name Type Explanation
spreadsheet_name hidden The spreadsheet that we will use. It must be created up front.
sheet_name hidden Use to check on the sheet that we will use to insert the data
  • Please configure the extrouter web.config as per below
    • To get this client id and client secret, please visit [Google oAuth]
 <add key="google_client_id" value="xxxx.apps.googleusercontent.com" />
 <add key="google_client_secret" value="xx6iuHUkAcRYfAFmLKvwVfvurT" />


  • Please configure the refresh token
    • Refresh token would be the key token that will enable the system to upload data to your spreadsheet without your user name and password
    • To get refresh token, type http://yourwebsite.com/google_spreadsheet. You will be ask to login under your google mail account
 <add key="refresh_token" value="xxx" />
  • Since we have updated one of the component (newton), please update the web.config to below
       <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
       <bindingRedirect oldVersion="0.0.0.0-4.5.0.0" newVersion="4.5.0.0" />
  • Make sure that you have created the spreadsheet into your google drive with the same name as spreadsheet_name

Setup guide on the form[edit | edit source]

  • Create all the three hidden field as per stated in the Prerequisite
  • Put the form action to "google_spreadsheet" and method to "post"
  • Please make sure all the form have the field which will be sent over from the form to google docs. If there is a missing field, you will get an error like below.
Please make sure all the fields below is listed in the spreadsheet -> Field: spreadsheet_name -> Field: sheet_name -> Field: success_return -> Field: productname -> Field: productqty -> Field: name -> Field: email -> Field: mobile -> Field: address
  • If you are doing correctly, the system will push the screen to success_url which you have configure in the hidden field