{{ }}
for expressions and <style>
tags for CSS. JS in <script>
tags is included but not executed in n8n.',
name: 'notice',
type: 'notice',
default: '',
displayOptions: {
show: {
operation: ['generateHtmlTemplate'],
},
},
},
{
displayName: 'Source Data',
name: 'sourceData',
type: 'options',
options: [
{
name: 'Binary',
value: 'binary',
},
{
name: 'JSON',
value: 'json',
},
],
default: 'json',
description: 'If HTML should be read from binary or JSON data',
displayOptions: {
show: {
operation: ['extractHtmlContent'],
},
},
},
{
displayName: 'Input Binary Field',
name: 'dataPropertyName',
type: 'string',
requiresDataPath: 'single',
displayOptions: {
show: {
operation: ['extractHtmlContent'],
sourceData: ['binary'],
},
},
default: 'data',
required: true,
hint: 'The name of the input binary field containing the file to be extracted',
},
{
displayName: 'JSON Property',
name: 'dataPropertyName',
type: 'string',
requiresDataPath: 'single',
displayOptions: {
show: {
operation: ['extractHtmlContent'],
sourceData: ['json'],
},
},
default: 'data',
required: true,
description:
'Name of the JSON property in which the HTML to extract the data from can be found. The property can either contain a string or an array of strings.',
},
{
...extractionValuesCollection,
displayOptions: {
show: {
operation: ['extractHtmlContent'],
'@version': [1],
},
},
},
{
...extractionValuesCollection,
default: {
values: [
{
key: '',
cssSelector: '',
returnValue: 'text',
returnArray: false,
},
],
},
displayOptions: {
show: {
operation: ['extractHtmlContent'],
'@version': [{ _cnd: { gt: 1 } }],
},
},
},
{
displayName: 'Options',
name: 'options',
type: 'collection',
placeholder: 'Add option',
default: {},
displayOptions: {
show: {
operation: ['extractHtmlContent'],
},
},
options: [
{
displayName: 'Trim Values',
name: 'trimValues',
type: 'boolean',
default: true,
description:
'Whether to remove automatically all spaces and newlines from the beginning and end of the values',
},
{
displayName: 'Clean Up Text',
name: 'cleanUpText',
type: 'boolean',
default: true,
description:
'Whether to remove leading and trailing whitespaces, line breaks (newlines) and condense multiple consecutive whitespaces into a single space',
},
],
},
// ----------------------------------
// convertToHtmlTable
// ----------------------------------
{
displayName: 'Options',
name: 'options',
type: 'collection',
placeholder: 'Add option',
default: {},
displayOptions: {
show: {
operation: ['convertToHtmlTable'],
},
},
options: [
{
displayName: 'Capitalize Headers',
name: 'capitalize',
type: 'boolean',
default: false,
description: 'Whether to capitalize the headers',
},
{
displayName: 'Custom Styling',
name: 'customStyling',
type: 'boolean',
default: false,
description: 'Whether to use custom styling',
},
{
displayName: 'Caption',
name: 'caption',
type: 'string',
default: '',
description: 'Caption to add to the table',
},
{
displayName: 'Table Attributes',
name: 'tableAttributes',
type: 'string',
default: '',
description: 'Attributes to attach to the table',
placeholder: 'e.g. style="padding:10px"',
},
{
displayName: 'Header Attributes',
name: 'headerAttributes',
type: 'string',
default: '',
description: 'Attributes to attach to the table header',
placeholder: 'e.g. style="padding:10px"',
},
{
displayName: 'Row Attributes',
name: 'rowAttributes',
type: 'string',
default: '',
description: 'Attributes to attach to the table row',
placeholder: 'e.g. style="padding:10px"',
},
{
displayName: 'Cell Attributes',
name: 'cellAttributes',
type: 'string',
default: '',
description: 'Attributes to attach to the table cell',
placeholder: 'e.g. style="padding:10px"',
},
],
},
],
};
async execute(this: IExecuteFunctions): Promise' + capitalizeHeader(header, options.capitalize as boolean) + ' | ') .join(''); table += '
---|
`; if (typeof entry[header] === 'boolean') { const isChecked = entry[header] ? 'checked="checked"' : ''; td += ``; } else { td += entry[header]; } td += ' | '; return td; }) .join(''); table += '