The idea is:
To be able to have options loading based on a neighboring UI element inside a fixedCollection with multiple items.
The UI elements of type options
can have:
typeOptions: {
loadOptionsMethod: 'functionName',
loadOptionsDependsOn: ['path.to.element'],
},
The loadOptionsDependsOn
makes the dropdown menu reload when the value of the specified element(s) is changed. However, I didn’t find a way to have a fixedCollection
UI element with multiple items which contains an options
UI element depending on the value of another UI element in the same item of the fixedCollection
. This is because neither of the 2 typeOptions
properties have access to the fixedCollection
item index. It will be useful to:
- have access to the
$index
of the item in theloadOptionsDependsOn
- have information about the parameter path of the parameter for which the
loadOptions
are being loaded in the in theILoadOptionsFunctions
interface
My use case:
I was able to specify a dependency between 2 options
parameters in the following way:
{
displayName: 'Field Name',
name: 'fieldName',
required: true,
type: 'options',
default: '',
typeOptions: {
loadOptionsDependsOn: ['additionalFields.customFields.fieldValues[0].schemaName'],
loadOptionsMethod: 'getSchemaFields',
},
},
where "additionalFields " is a collection
and “customFields” is a fixedCollection
with multiple items.
I wanted to be able to specify:
{
displayName: 'Field Name',
name: 'fieldName',
required: true,
type: 'options',
default: '',
typeOptions: {
loadOptionsDependsOn: ['=additionalFields.customFields.fieldValues[{{$index}}].schemaName'],
loadOptionsMethod: 'getSchemaFields',
},
},
and then be able to access the path of “fieldName” (e.g. “additionalFields.customFields.fieldValues[3].fieldName”) in the getSchemaFields()
.
I think it would be beneficial to add this because:
This feature will allow the options
UI elements to depend on neighboring UI elements when they are nested in a fixedCollection
UI element with multiple items.
Any resources to support this?
I found good examples for loadOptionsDependsOn
at the Teams node.
I found examples of using $index
to specify the item index in the routing.send
property in the WhatsApp node.