Hey,
I’m trying to add a custom field (TheHive feature, more information here) support to the TheHive node, but I’m having a bit of trouble generating a good UI. Is it possible to load options for a collection node property (its options being INodeProperties
)? I tried a bunch of stuff but the interface for INodeType seems to limit the return values of methods.loadOptions
to INodePropertyOptions[]
only.
Another way to create the custom fields UI would be using fixedCollection
, but as the value of the custom field can be string, number, boolean, or a date, I can’t think of a way to let the user choose the value type.
Here’s what I tried with the fixedCollection
:
{
displayName: 'Custom Fields',
name: 'customFields',
type: 'fixedCollection',
default: {},
typeOptions: {
multipleValues: true,
},
placeholder: 'Add Custom Field',
displayOptions: {
show: {
resource: ['alert'],
},
},
options: [
{
name: 'customFieldsUi',
displayName: 'Custom Field',
values: [
{
displayName: 'Field',
name: 'field',
type: 'options',
typeOptions: {
loadOptionsMethod: 'loadCustomFields',
},
default: '',
},
{
displayName: 'Value',
name: 'value',
type: 'string',
default: '',
description: '',
},
],
},
],
},