Select to view content in your preferred language

How to register a custom Data Action in ArcGIS Experience Builder 1.18

111
3
Friday
Labels (1)
MadhubalaK
New Contributor

Hi everyone,

I’m trying to add a new export option (“Export to Tab”) that should appear inside the Map Popup’s Data Action list — alongside the existing actions such as Export CSV, Export GeoJSON, etc.    

MadhubalaK_1-1760092232860.png

I understand that data actions can be managed via the DataActionManager class in jimu-core/lib/data-action-manager.
I attempted to register a new DataAction dynamically like this:

import { DataActionManager } from 'jimu-core';

const manager = DataActionManager.getInstance();

await manager.registerAction({
id: 'export-tab',
label: 'Export to Tab',
icon: 'export',
uri: '../data-actions/export-to-tab'
});

 

And my export-to-tab.ts looks like this:

import { AbstractDataAction, DataRecordSet, DataLevel } from 'jimu-core';

export default class ExportToTabAction extends AbstractDataAction {
id = 'export-tab';
label = 'Export to Tab';
icon = 'export';

async isSupported(dataSets: DataRecordSet[], dataLevel: DataLevel, widgetId: string): Promise<boolean> {
return dataSets?.length > 0;
}

async onExecute(dataSets: DataRecordSet[], dataLevel: DataLevel, widgetId: string): Promise<boolean> {
console.log('Export to Tab clicked:', dataSets);
return true;
}
}

The registration runs without any error, but my new “Export to Tab” option does not appear in the popup’s Data Action list when clicking on a feature in the map.
When I log manager.getActions(), I can see the built-in ones (like Export CSV, Export GeoJSON, etc.), but not my custom action.

 

 

 

 

0 Kudos
3 Replies
ShengdiZhang
Esri Regular Contributor

Hi @MadhubalaK ,

Please try using ActionClass instead of uri.

ShengdiZhang_0-1760149985004.png

Regards,

Shengdi

0 Kudos
MadhubalaK
New Contributor

Hi @ShengdiZhang , Thank you for your reply.

I have added the ActionClass instead of the URI. Now, the Export to Tab option appears in the existing Action List.

MadhubalaK_0-1760353883740.png

However, I want to add the Export to Tab option to the already existing Export Options instead of the general Action List.

  • I want to add it directly into the Export Options dropdown/panel, so that users can see it alongside the other export choices.

MadhubalaK_1-1760354483222.png

  • Could you guide me on how to integrate the ActionClass specifically into the Export Options rather than the general Actions?

 

0 Kudos
ShengdiZhang
Esri Regular Contributor

Hi, when registering the action, please set the name to ‘export’.

ShengdiZhang_0-1760409505085.png

 

0 Kudos