(Integration) Allow types different than string for an INodePropertyOptions value field

When getting custom fields from an API, it would be a nicer user experience to guide the user by adapting the field to the data type.

These custom fields are returned by a method defined in loadOptions.

As shown below, loadOptions can only return an array of INodePropertyOptions
image

It seems that INodePropertyOptions doesn’t have a way to define the type of the expected data (number, string, boolean, options…).


There is no ‘type’ field

On the other hand, INodeProperties has a type field that permits this.

Is there a way to define the data type inside of an INodePropertyOptions component ?

Thank you

Information on your n8n setup

  • n8n version: 0.172.0
  • Database you’re using (default: SQLite): SQLite
  • Running n8n with the execution process [own(default), main]: npm run dev
  • Running n8n via [Docker, npm, n8n.cloud, desktop app]: npm

Hey @paulglx,
if I understood you right, the Notion node could be interesting for you. When creating a Database Page you can select a property key.

Once selected a second field appears specific to the property type.

The DatabasePageDescription.ts implementation is using a Fixed Collection and a hidden type property to choose what kind of UI element to show.

2 Likes

This is exactly what I was searching for, thank you !

1 Like