Skip to main content
Michel L
February 14, 2025
Solved

Creating a dataconnector - how to define an array

  • February 14, 2025
  • 2 replies
  • 69 views

Creating a dataconnector for retrieving document list, the only way I found is to define an array is to use a declaration field as any:

...
{
name: "customAttributes",
type: ScalarFieldTypeEnum.ANY,
},
{
name: "customTags",
type: ScalarFieldTypeEnum.ANY,
},

which  IMHO is not good I would like to use things like 

    {
name: "customAttributes",
type: []ScalarFieldTypeEnum.STRING,
},
{
name: "customTags",
type: []ScalarFieldTypeEnum.STRING,
},

Any suggestions?

Best regards.

 

Best answer by Michael B

Hello Michel,

 

I believe this syntax is what you need:

        fieldName: {
type: new FieldTypeArray([ScalarFieldTypeEnum.STRING as const]),
},

 

Comments

Michael B
Michael BAnswer
Lucid product team
February 14, 2025

Hello Michel,

 

I believe this syntax is what you need:

        fieldName: {
type: new FieldTypeArray([ScalarFieldTypeEnum.STRING as const]),
},

 

Michel L
Michel LAuthor
February 17, 2025

Many thanks ​@Michael B . That’s the solution.

Regards.