'Create a new record, or update the current one if it already exists (upsert)',
action:'Create or update a sheet',
},
{
name:'Delete',
value:'delete',
description:'Delete columns and rows from a sheet',
action:'Delete a sheet',
},
{
name:'Lookup',
value:'lookup',
description:'Look up a specific column value and return the matching row',
action:'Look up a column value in a sheet',
},
{
name:'Read',
value:'read',
description:'Read data from a sheet',
action:'Read a sheet',
},
{
name:'Remove',
value:'remove',
description:'Remove a sheet',
action:'Remove a sheet',
},
{
name:'Update',
value:'update',
description:'Update rows in a sheet',
action:'Update a sheet',
},
],
default:'read',
},
// ----------------------------------
// All
// ----------------------------------
{
displayName:'Spreadsheet ID',
name:'sheetId',
type:'string',
displayOptions:{
show:{
resource:['sheet'],
},
},
default:'',
required: true,
description:
'The ID of the Google Spreadsheet. Found as part of the sheet URL https://docs.google.com/spreadsheets/d/{ID}/.',
},
{
displayName:'Range',
name:'range',
type:'string',
displayOptions:{
show:{
resource:['sheet'],
},
hide:{
operation:['create','delete','remove'],
},
},
default:'A:F',
required: true,
description:
'The table range to read from or to append data to. See the Google <a href="https://developers.google.com/sheets/api/guides/values#writing">documentation</a> for the details. If it contains multiple sheets it can also be added like this: "MySheet!A:F"',
},
// ----------------------------------
// Delete
// ----------------------------------
{
displayName:'To Delete',
name:'toDelete',
placeholder:'Add Columns/Rows to delete',
description:'Deletes columns and rows from a sheet',
'Index of the first row which contains the actual data and not the keys. Starts with 0.',
},
// ----------------------------------
// Mixed
// ----------------------------------
{
displayName:'Key Row',
name:'keyRow',
type:'number',
typeOptions:{
minValue: 0,
},
displayOptions:{
show:{
resource:['sheet'],
},
hide:{
operation:['clear','create','delete','remove'],
rawData:[true],
},
},
default:0,
description:
'Index of the row which contains the keys. Starts at 0. The incoming node data is matched to the keys for assignment. The matching is case sensitive.',
},
// ----------------------------------
// lookup
// ----------------------------------
{
displayName:'Lookup Column',
name:'lookupColumn',
type:'string',
default:'',
placeholder:'Email',
required: true,
displayOptions:{
show:{
resource:['sheet'],
operation:['lookup'],
},
},
description:'The name of the column in which to look for value',
},
{
displayName:'Lookup Value',
name:'lookupValue',
type:'string',
default:'',
placeholder:'frank@example.com',
displayOptions:{
show:{
resource:['sheet'],
operation:['lookup'],
},
},
description:'The value to look for in column',
},
// ----------------------------------
// Update
// ----------------------------------
{
displayName:'Key',
name:'key',
type:'string',
default:'id',
displayOptions:{
show:{
resource:['sheet'],
operation:['update','upsert'],
rawData:[false],
},
},
description:'The name of the key to identify which data should be updated in the sheet',
'By default only the first result gets returned. If options gets set all found matches get returned.',
},
{
displayName:'Use Header Names as JSON Paths',
name:'usePathForKeyRow',
type:'boolean',
default:false,
displayOptions:{
show:{
'/operation':['append'],
},
},
description:
'Whether you want to match the headers as path, for example, the row header "category.name" will match the "category" object and get the field "name" from it. By default "category.name" will match with the field with exact name, not nested object.',
},
{
displayName:'Value Input Mode',
name:'valueInputMode',
type:'options',
displayOptions:{
show:{
'/operation':['append','update','upsert'],
},
},
options:[
{
name:'RAW',
value:'RAW',
description:'The values will not be parsed and will be stored as-is',
},
{
name:'User Entered',
value:'USER_ENTERED',
description:
'The values will be parsed as if the user typed them into the UI. Numbers will stay as numbers, but strings may be converted to numbers, dates, etc. following the same rules that are applied when entering text into a cell via the Google Sheets UI.',
},
],
default:'RAW',
description:'Determines how data should be interpreted',
},
{
displayName:'Value Render Mode',
name:'valueRenderMode',
type:'options',
displayOptions:{
show:{
'/operation':['lookup','read'],
},
},
options:[
{
name:'Formatted Value',
value:'FORMATTED_VALUE',
description:
"Values will be calculated & formatted in the reply according to the cell's formatting.Formatting is based on the spreadsheet's locale, not the requesting user's locale.For example, if A1 is 1.23 and A2 is =A1 and formatted as currency, then A2 would return \"$1.23\"",
},
{
name:'Formula',
value:'FORMULA',
description:
'Values will not be calculated. The reply will include the formulas. For example, if A1 is 1.23 and A2 is =A1 and formatted as currency, then A2 would return "=A1".',
},
{
name:'Unformatted Value',
value:'UNFORMATTED_VALUE',
description:
'Values will be calculated, but not formatted in the reply. For example, if A1 is 1.23 and A2 is =A1 and formatted as currency, then A2 would return the number 1.23.',
},
],
default:'UNFORMATTED_VALUE',
description:'Determines how values should be rendered in the output',
},
{
displayName:'Value Render Mode',
name:'valueRenderMode',
type:'options',
displayOptions:{
show:{
'/operation':['update','upsert'],
'/rawData':[false],
},
},
options:[
{
name:'Formatted Value',
value:'FORMATTED_VALUE',
description:
"Values will be calculated & formatted in the reply according to the cell's formatting.Formatting is based on the spreadsheet's locale, not the requesting user's locale. For example, if A1 is 1.23 and A2 is =A1 and formatted as currency, then A2 would return \"$1.23\".",
},
{
name:'Formula',
value:'FORMULA',
description:
'Values will not be calculated. The reply will include the formulas. For example, if A1 is 1.23 and A2 is =A1 and formatted as currency, then A2 would return "=A1".',
},
{
name:'Unformatted Value',
value:'UNFORMATTED_VALUE',
description:
'Values will be calculated, but not formatted in the reply. For example, if A1 is 1.23 and A2 is =A1 and formatted as currency, then A2 would return the number 1.23.',
},
],
default:'UNFORMATTED_VALUE',
description:'Determines how values should be rendered in the output',
},
],
},
{
displayName:'Operation',
name:'operation',
type:'options',
noDataExpression: true,
displayOptions:{
show:{
resource:['spreadsheet'],
},
},
options:[
{
name:'Create',
value:'create',
description:'Create a spreadsheet',
action:'Create a spreadsheet',
},
],
default:'create',
},
// ----------------------------------
// spreadsheet:create
// ----------------------------------
{
displayName:'Title',
name:'title',
type:'string',
default:'',
displayOptions:{
show:{
resource:['spreadsheet'],
operation:['create'],
},
},
description:'The title of the spreadsheet',
},
{
displayName:'Sheets',
name:'sheetsUi',
placeholder:'Add Sheet',
type:'fixedCollection',
typeOptions:{
multipleValues: true,
},
default:{},
displayOptions:{
show:{
resource:['spreadsheet'],
operation:['create'],
},
},
options:[
{
name:'sheetValues',
displayName:'Sheet',
values:[
{
displayName:'Sheet Properties',
name:'propertiesUi',
placeholder:'Add Property',
type:'collection',
default:{},
options:[
{
displayName:'Hidden',
name:'hidden',
type:'boolean',
default:false,
description:'Whether the Sheet should be hidden in the UI',