Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7813875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T05:00:46+00:00 2026-06-02T05:00:46+00:00

I am trying to add a new row in a google spreadsheet via JavaScript/JQuery.

  • 0

I am trying to add a new row in a google spreadsheet via JavaScript/JQuery. I have no idea how to do this, but here is my attempt:

        var myJSONObject = {"entry": [
         "gsx:name": name,
         "gsx:email": email,
         "gsx:phone": phone,
         "gsx:guests": guests
        ]}

        var json_uri = "https://spreadsheets.google.com/feeds/list/" + KEY + "/" + id + "/" + SECURE + "/values?alt=json"

        $.ajax({
         type: "POST",
         url: json_uri,
         //contentType: 'application/json',
         data: myJSONobject
         dataType: 'json',
         success: function(data){
            alert("row added!");
         },
         error: function(){
            alert("error");
         }
    });

but I keep getting the error 🙁

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T05:00:47+00:00Added an answer on June 2, 2026 at 5:00 am

    I’m not sure about using the jQuery ajax api but you might try constructing an xml entry as below and setting your parameters as shown.

    Perhaps someone else can show how to do it with the jQuery api?

    gdocs.constructSpreadAtomXml_ = function(name, email, phone, guests) {    
        var atom = ["<?xml version='1.0' encoding='UTF-8'?>",
                  '<entry xmlns="http://www.w3.org/2005/Atom" xmlns:gsx="http://schemas.google.com/spreadsheets/2006/extended">',
                  '<gsx:name>',name,'</gsx:title>',
                  '<gsx:email>',email,'</gsx:url>',
                  '<gsx:phone>',phone,'</gsx:summary>',
                  '<gsx:guests>',guests,'</gsx:tags>',
                  '</entry>'].join('');
        return atom;
    };
    

    …

    var params = {
        'method': 'POST',
        'headers': {
          'GData-Version': '3.0',
          'Content-Type': 'application/atom+xml'
        },
    
        'body': gdocs.constructSpreadAtomXml_(name, email, phone, guests)
    };
    
      var worksheetId = 'od6'; //The first worksheet.
    
      var url = 'https://spreadsheets.google.com/feeds'+'/list/'+docId+'/'+worksheetId+'/private/full';
    
      //sends the params to the background page to get delivered to gDocs
      oauth.sendSignedRequest(url, handleSuccess, params);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to add a new row in a table via javascript. I
I am trying to add a new row into a gridview but for some
I'm trying to add a new row to a DataGridView from FORM 2 but
I'm trying to add a row to google spreadsheet. They give a source https://developers.google.com/google-apps/spreadsheets/#adding_a_list_row
I am trying to get a new dynamically created row to add to a
I'm fairly new to JQuery and I'm trying to add multiple form fields for
Hey there, new to AJAX, JS.. Im trying to add to a Javascript/Ajax search
I'm trying to create a new contact and add it to the AddressBook but
I am trying to add a new row to the table. The new row
I'm trying to add a table row with ajax/jquery that has a form element

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.