mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
⚡ Add 'typecast' functionality to Airtable node (#922)
* Added 'typecast' functionality for Airtable node as offered by the official API. Minor grammatical corrections for some descriptions in the same node. * Fixed minor issue with erroneous tabs/spaces added whilst editing Co-authored-by: stewart-is <40069421+stewart-is@users.noreply.github.com>
This commit is contained in:
parent
e5065ce0de
commit
8221cb5d24
|
@ -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}`;
|
||||
|
|
Loading…
Reference in a new issue