Hey!
I need to create a node with a fixed property template
as options and other dynamic properties that depend on the value of this template
description: INodeTypeDescription = {
displayName: 'Promptify',
name: 'promptify',
group: ['transform'],
version: 1,
description: 'Basic Promptify Node',
defaults: {
name: 'Promptify',
},
inputs: ['main'],
outputs: ['main'],
properties: [
{
displayName: 'Templates',
name: 'template',
type: 'options',
default: '',
placeholder: 'Choose a template',
description: 'Choose a template and start generating',
typeOptions: {
loadOptionsMethod: 'getTemplates'
}
},
{
displayName: 'Inputs',
name: 'inputs',
type: 'json',
default: '',
placeholder: 'Template Inputs',
description: 'Inputs to be used',
typeOptions: {
loadOptionsDependsOn: ['template'],
loadOptionsMethod: 'getInputs',
}
},
],
};
Inside getInputs
I can get the template
value and fetch API data based on it. based on this fetched data I need to display questions as properties/inputs
. These questions are different from one template to another.
I know that I can control the display of properties using the show
attribute or make a property loadOptionsDependsOn
, but that’s not exactly my use case, because I can’t control or predict the fetched properties’ names/types…etc.
Thanks.