Skip to main content
Answer

Creating a dataconnector - how to define an array

  • February 14, 2025
  • 2 replies
  • 36 views

Michel L
Forum|alt.badge.img+11

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
Forum|alt.badge.img+4
  • Lucid product team
  • Answer
  • February 14, 2025

Hello Michel,

 

I believe this syntax is what you need:

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

 


Michel L
Forum|alt.badge.img+11
  • Author
  • February 17, 2025

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

Regards.