Skip to main content
Version: Release 1 - 1.1.3.X

Extension Actions

Programmatically inspect the actions that are registered in your map experience and invoke them against either a single feature or a collection of features. These helpers mirror the Action menu availability inside the Power Maps UI, making it easy to wire automations, quick buttons, or custom selection workflows.

getSingleActions

Return the ordered list of single-record actions that the current map instance exposes.

Parameters

None.

Response shape

FieldTypeDescription
idstringUnique identifier for the action (matches the Action definition record).
actionNamestringDisplay label surfaced in the UI.
actionIconstringFluent UI icon name rendered alongside the label.
actionTypeActionTypeCategorises how the action behaves (open form, run flow, custom, etc.).
actionOrdernumberIndicates the preferred ordering in menus.
actionDataIKeyValue[]Arbitrary configuration payload passed into the action implementation.
actionFilterFilter | undefinedOptional layer filter that the action applies once it completes.
actionRefresh* flagsboolean | undefinedSignal whether related layers should refresh after execution.
info
  • The returned array is already filtered down to actions that are valid for single selections in the current context.
  • Check out the full list of actions

Usage

const control = globalThis.MaptaskrControlManager.getControl(controlId);

const singleActions = control.getSingleActions();

singleActions.forEach((action) => {
console.log(`${action.actionName} (${action.actionType})`);
});

getMultiActions

Return the multi-record actions that can operate on a batch of features.

Parameters

None.

Response shape

FieldTypeDescription
idstringUnique identifier for the action (matches the Action definition record).
actionNamestringDisplay label surfaced in the UI.
actionIconstringFluent UI icon name rendered alongside the label.
actionTypeActionTypeCategorises how the action behaves (open form, run flow, custom, etc.).
actionOrdernumberIndicates the preferred ordering in menus.
actionDataIKeyValue[]Arbitrary configuration payload passed into the action implementation.
actionFilterFilter | undefinedOptional layer filter that the action applies once it completes.
actionRefresh* flagsboolean | undefinedSignal whether related layers should refresh after execution.
info
  • The returned array is already filtered down to actions that are valid for single selections in the current context.
  • Check out the full list of actions

Usage – surface as custom UI

const control = globalThis.MaptaskrControlManager.getControl(controlId);

const multiActions = control.getMultiActions();

multiActions.forEach((action) => {
console.log(`${action.actionName} (${action.actionType})`);
});

executeSingleAction

Run a single-record action against a specific feature that you resolved via the Extension Method API.

Parameters

NameTypeRequiredDescription
actionIActionYesOne of the objects returned by getSingleActions().
customFeatureCustomFeatureYesFeature payload containing featureId, layerInstanceId, geometry, and properties.
successCallback() => voidNoInvoked when the underlying action resolves without warnings. Defaults to a console log.
warningCallback() => voidNoTriggered when the action reports a soft failure. Defaults to a console warning.
errorCallback() => voidNoTriggered when the action throws. Defaults to a console error.

Usage – launch the first matching action

const control = globalThis.MaptaskrControlManager.getControl(controlId);

// params comes from the ExecuteJS functionParameters which looks like this {{contactid}}

globalThis.ExecuteSingleJS = async function(params) { // Name of function of your choice
const singleActions = control.getSingleActions();
const openD365Action = singleActions.find((a) => a.actionType === 'OpenD365Modal');

if (openD365Action) {
const updatedAction = {
...openD365Action,
actionData: [
{ key: 'entityName', value: 'contact' },
{ key: 'entityId', value: params },
{ key: 'formPosition', value: 'center' },
// To pass formProps use the below example. these value will need to passed through functionParameters
// {
// key: 'formProps',
// value: JSON.stringify([
// { key: '[FIELD NAME]', value: '[VALUE]', dataType: 'string' },
// ]),
// },
],
};

const [firstFeature] = control.getSelectedFeatures();
if (firstFeature) {
await control.executeSingleAction(
updatedAction,
firstFeature,
() => console.log('Success!'),
() => console.warn('Warning'),
() => console.error('Error')
);
}
}
}

note

All callbacks are optional; when omitted the Extension Method Service writes to the browser console.

executeMultiAction

Batch-execute one action across multiple features—ideal for mass updates, templated emails, or workflow orchestration.

Parameters

NameTypeRequiredDescription
actionIActionYesMust come from getMultiActions() or another action definition that supports multi-select.
customFeaturesCustomFeature[]YesCollection of features to execute against. Empty arrays are ignored.
successCallback() => voidNoRuns if every invocation succeeds.
warningCallback() => voidNoRuns when at least one invocation emits a warning.
errorCallback() => voidNoRuns when the batch execution fails.

Usage – execute against current selection

const control = globalThis.MaptaskrControlManager.getControl(controlId);
// In this example we will create a new work order and pass the selected contacts id to a field in the form called msdyn_workordersummary.
// params comes from the ExecuteJS functionParameters which looks like this `{{contactid|,}}`

globalThis.ExecuteMultiJS = async function (params) {

const multiActions = control.getMultiActions();
const createWorkOrder = multiActions.find((a) => a.actionType === 'OpenD365Modal');

const selectedFeatures = control.getSelectedFeatures();
if (!selectedFeatures?.length) {
console.warn('Select at least one feature before running the action.');
return;
}

const updatedAction = {
...createWorkOrder,
actionData: [
{ key: 'entityName', value: 'msdyn_workorder' },
{ key: 'entityId', value: ''},
{ key: 'formPosition', value: 'center' },
{
key: 'formProps',
value: JSON.stringify([
{ key: 'msdyn_workordersummary', value: params, dataType: 'string' },
]),
},
],
};

await control.executeMultiAction(
updatedAction,
selectedFeatures,
() => console.log('Bulk edit complete'),
() => console.warn('Bulk edit completed with warnings'),
() => console.error('Bulk edit failed')
);
};
info
  • All provided features are validated before the action service runs. Any features that cannot be resolved cause the entire execution to short-circuit.
  • Use the callbacks to keep your UI state in sync (refresh lists, close panels, etc.).
  • Multi actions respect the same refresh flags (actionRefreshSublayersEnabled, actionAllLayersRefreshEnabled, etc.) that you configure on the action definition.