Skip to content

Converting Sheets to XML

This task will convert an Google Sheet to an XML file. The file generated can then be used as the input to other tasks, for example anĀ XSLT Transform could be used to convert the XML to the Zynk XML format, ready for import into Sage.

Settings

Google Workspace Connection

Required
The Google Workspace connection to use. See the Connecting to Google Workspace article if you require more information on how to create/manage connections.

First Row Is Header

Required
Determines whether the task should treat the first row in the selected range as a header row. Defaults to False.

When set to True, the task won't include the first row in the output, but the values from it will be used as the column names. If a cell in the first row is empty, it will fall back to a default column name as described below.

When set to False, the task will output all rows in the selected range, and columns will be assigned a default name in the form Column1, Column2 etc.

Range

Required
Specify the sheet name and/or range of cells to export, using either A1 or R1C1 notation. E.g. Sheet1!A1:B2. Defaults to Sheet1, which will select all data from the worksheet called 'Sheet1'.

Spreadsheet ID

Required
The ID of the spreadsheet to export. This can be found in the URL of the spreadsheet.

Output File

Required
The file to write the data from the spreadsheet to.

Zynk Settings

See Common Task Settings

Examples

Sample output file (with 'First Row Is Header' set to True):

<?xml version="1.0" encoding="utf-8"?>
<Rows>
  <Row>
    <SKU>20000</SKU>
    <Name>Large Red T-Shirt</Name>
    <NominalCode>4000</NominalCode>
    <Note>For pricing, check online</Note>
  </Row>
  <Row>
    <SKU>20001</SKU>
    <Name>Small Blue Hoodie</Name>
    <NominalCode>4001</NominalCode>
  </Row>
</Rows>

Sample output file (with 'First Row Is Header' set to False):

<?xml version="1.0" encoding="utf-8"?>
<Rows>
  <Row>
    <Column1>SKU</Column1>
    <Column2>Name</Column2>
    <Column3>NominalCode</Column3>
    <Column4>Note</Column4>
  </Row>
  <Row>
    <Column1>20000</Column1>
    <Column2>Large Red T-Shirt</Column2>
    <Column3>4000</Column3>
    <Column4>For pricing, check online</Column4>
  </Row>
  <Row>
    <Column1>20001</Column1>
    <Column2>Small Blue Hoodie</Column2>
    <Column3>4001</Column3>
  </Row>
</Rows>