How to declare data scheme with object with array of custom objects in it?

  • 23 May 2023
  • 1 reply

I want to implement my dataConnector and post some custom data(like object with array of object as a field in it): 
class MyClass { 
   subItems: SubItem[]
class SubItem {
Maybe you have some examples how to do this because some examples from documentation I guess are out of date.



Hi Dennis

Thank you for contributing to the Lucid for Developers Community! I recommend taking a look at our recently released Asana integration. It serves as a more comprehensive example that you can reference.

You can find the relevant code in the asanacardintegration.ts file specifically where the editor extension requests a data action:

        import: async (
            primaryKeys: string[]
            searchFields: Map<string SerializedFieldType>
        ): Promise<{collection: CollectionProxy; primaryKeys: string[]}> => {
            const workspaceId = searchFields.get('workspace');
            if (!isString(workspaceId) || !workspaceId) {
                throw new Error('No workspace selected');
            await this.editorClient.performDataAction({
                dataConnectorName: 'asana'
                syncDataSourceIdNonce: workspaceId
                actionName: 'Import'
                actionData: {workspaceId taskIds: => JSON.parse(pk))}
                asynchronous: true

            const collection = await this.editorClient.awaitDataImport('asana' workspaceId 'Tasks' primaryKeys);

            return {collection primaryKeys};


And then where the data connector handles that request in importaction.ts:

export const importAction: AsanaAction<DataConnectorAsynchronousAction> = async ({action asanaClient}) => {
    if (!importBodyValidator( {
        throw new DataConnectorRunError(404 'Body must be of type {workspaceId:string taskIds:string[]}');

    const {workspaceId taskIds} =;
    const fullTaskData = await importTasks(new Set(taskIds) asanaClient);
    return await uploadTasks(action.client workspaceId fullTaskData asanaClient);

You'll also probably want to take a look at where the data connector gets defined in index.ts.


Let me know if you get stuck!