diff --git a/packages/nodes-base/nodes/Airtable/Airtable.node.ts b/packages/nodes-base/nodes/Airtable/Airtable.node.ts index acdee495e..42a5c2900 100644 --- a/packages/nodes-base/nodes/Airtable/Airtable.node.ts +++ b/packages/nodes-base/nodes/Airtable/Airtable.node.ts @@ -107,7 +107,7 @@ export class Airtable implements INodeType { }, }, default: true, - description: 'If all fields should be send to Airtable or only specific ones.', + description: 'If all fields should be sent to Airtable or only specific ones.', }, { displayName: 'Fields', @@ -130,7 +130,7 @@ export class Airtable implements INodeType { default: [], placeholder: 'Name', required: true, - description: 'The name of fields of which the data should be send to Airtable.', + description: 'The name of fields for which data should be sent to Airtable.', }, // ---------------------------------- @@ -188,7 +188,7 @@ export class Airtable implements INodeType { maxValue: 100, }, default: 100, - description: 'How many results to return.', + description: 'Number of results to return.', }, { @@ -331,7 +331,7 @@ export class Airtable implements INodeType { }, }, default: true, - description: 'If all fields should be send to Airtable or only specific ones.', + description: 'If all fields should be sent to Airtable or only specific ones.', }, { displayName: 'Fields', @@ -354,8 +354,29 @@ export class Airtable implements INodeType { default: [], placeholder: 'Name', required: true, - description: 'The name of fields of which the data should be send to Airtable.', + description: 'The name of fields for which data should be sent to Airtable.', }, + + // ---------------------------------- + // append + update + // ---------------------------------- + + { + displayName: 'Typecast', + name: 'typecast', + type: 'boolean', + displayOptions: { + show: { + operation: [ + 'append', + 'update', + ], + }, + }, + default: false, + description: 'If the Airtable API should attempt mapping of string values for linked records & select options.', + }, + ], }; @@ -386,6 +407,7 @@ export class Airtable implements INodeType { let addAllFields: boolean; let fields: string[]; + let typecast: boolean; for (let i = 0; i < items.length; i++) { addAllFields = this.getNodeParameter('addAllFields', i) as boolean; @@ -403,6 +425,11 @@ export class Airtable implements INodeType { body.fields[fieldName] = items[i].json[fieldName]; } } + + typecast = this.getNodeParameter('typecast', i) as boolean; + if (typecast === true) { + body['typecast'] = true; + } responseData = await apiRequest.call(this, requestMethod, endpoint, body, qs); @@ -494,6 +521,7 @@ export class Airtable implements INodeType { let id: string; let updateAllFields: boolean; let fields: string[]; + let typecast: boolean; for (let i = 0; i < items.length; i++) { updateAllFields = this.getNodeParameter('updateAllFields', i) as boolean; @@ -512,6 +540,11 @@ export class Airtable implements INodeType { } } + typecast = this.getNodeParameter('typecast', i) as boolean; + if (typecast === true) { + body['typecast'] = true; + } + id = this.getNodeParameter('id', i) as string; endpoint = `${application}/${table}/${id}`;