Unable to append rows starting with column A everytime
03:07 06 Feb 2019

I am trying to append some values in spreadsheet using google api php client.

I have successfully added data in the sheet but every time I run the code, it start appending values from column where the previous ended in the next row.

I am trying to append values in new row every time but it must start from column A.

Here is my code.

$client  = getClient();
$service = new Google_Service_Sheets( $client );

$spreadsheetId = 'my-spreadsheet-id';
$range         = 'sheet1';

$values = array(
    array( "Item", "Cost", "Stocked", '', '', "Ship Date" )
);

$body   = new Google_Service_Sheets_ValueRange( array( 'values' => 
$values, 'majorDimension' => 'ROWS', 'range' => 'sheet1' ) );

$params = array( 'valueInputOption' => 'USER_ENTERED', 
'insertDataOption' => 'INSERT_ROWS' );

$service->spreadsheets_values->append( $spreadsheetId, $range, 
$body, $params );

Now, when I run this code it appends "Item" on column A of a new row and "Ship Date" on column F. This is correct.

But when I run the same code again, it appends the data in new row but starts with Column F and ends with column K.

I want the next time also the data should start appending from column A and ends on column F.

Please help me achieve this, I have read its documentation but couldn't make it work, tried to find answer on internet on various website but was not able to make it work. Can anyone please help me with this.

google-sheets google-sheets-api google-api-php-client