GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Net::Google::Spreadsheets::Row(3) User Contributed Perl Documentation Net::Google::Spreadsheets::Row(3)

Net::Google::Spreadsheets::Row - A representation class for Google Spreadsheet row.

  use Net::Google::Spreadsheets;

  my $service = Net::Google::Spreadsheets->new(
    username => 'mygoogleaccount@example.com',
    password => 'mypassword',
  );

  # get a row
  my $row = $service->spreadsheet(
    {
        title => 'list for new year cards',
    }
  )->worksheet(
    {
        title => 'Sheet1',
    }
  )->row(
    {
        sq => 'id = 1000'
    }
  );

  # get the content of a row
  my $hashref = $row->content;
  my $id = $hashref->{id};
  my $address = $hashref->{address};

  # update a row
  $row->content(
    {
        id => 1000,
        address => 'somewhere',
        zip => '100-0001',
        name => 'Nobuo Danjou',
    }
  );

  # get and set values partially
  
  my $value = $row->param('name');
  # returns 'Nobuo Danjou'

  # it's same by getting via param method without args, or content method:
  my $value_by_param = $row->param->{name};
  my $value_by_content = $row->content->{name};
  
  my $newval = $row->param({address => 'elsewhere'});
  # updates address (and keeps other fields) and returns new row value (with all fields)

  my $hashref2 = $row->param;
  # same as $row->content;

  # delete the row
  $row->delete;

sets and gets content value.

deletes the row.

Space characters in hash key of rows will be removed when you access rows. See below.

  my $ws = Net::Google::Spreadsheets->new(
    username => 'me@gmail.com', 
    password => 'foobar'
  )->spreadsheet({titile => 'sample'})->worksheet(1);
  $ws->batchupdate_cell(
    {col => 1,row => 1, input_value => 'name'},
    {col => 2,row => 1, input_value => 'mail address'},
  ); 
  $ws->add_row(
    {
        name => 'my name',
        mailaddress => 'me@gmail.com',
  #      above passes, below fails.
  #      'mail address' => 'me@gmail.com',
    }
  );

Instead, Net::Google::Spreadsheets::Table and Net::Google::Spreadsheets::Record allows space characters in column name.

  my $s = Net::Google::Spreadsheets->new(
    username => 'me@gmail.com', 
    password => 'foobar'
  )->spreadsheet({titile => 'sample'});

  my $t = $s->add_table(
    {
        worksheet => $s->worksheet(1),
        columns => ['name', 'mail address'],
    }
  );
  $t->add_record(
    {
        name => 'my name',
        'mail address' => 'me@gmail.com',
    }
  );

Rewritable attribute. You can get and set the value. So it's the same thing to get the value with param method or content attribute.

  my $value = $row->param('foo');
  # it's same
  my $value2 = $row->content->{'foo'};

<https://developers.google.com/google-apps/spreadsheets/>

Net::Google::AuthSub

Net::Google::Spreadsheets

Nobuo Danjou <danjou@soffritto.org>
2012-04-30 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.