Skip to main content

Custom actions

A custom action adds an item of your own to the Quick Actions menu of every identity or every request in the admin dashboard. Choosing it runs one of your organization's functions against that identity or request. For example, an action labeled "Resync from HRIS" on identities can call your HR system for the person on screen and report what it found.

A custom action only runs when a person chooses it. To run something by itself when a person's data changes, use a reaction.

Custom actions are under Extensibility > Custom Actions. Creating, editing and deleting them needs permission to manage custom actions.

Create a custom action​

  1. Open Extensibility > Custom Actions and select New custom action.
  2. Under Action details, enter the Label people see in the menu. Owlie generates the Slug from it. Choose the Entity type: Identity or Request. The slug and the entity type can't be changed after you create the action.
  3. Under Function and access, choose the Function. The list holds identity-action functions for an identity action and request-action functions for a request action. You can also create the function from here: Owlie opens the function editor, and Return to custom action setup brings you back with the function selected.
  4. Under Who can run it, tick the roles that may run the action. A new action starts with the Admin role ticked.
  5. Optionally, add an action form and set the presentation and safeguards.
  6. Select Create action. On an existing action, the button reads Save action.

You can save an action before its function is ready. It stays off, and you can't turn on Enabled until the function has a published version. Choosing a different function turns Enabled off again.

The list and the action's page show where an action stands:

StatusMeaning
Needs functionNo function is selected.
Needs publishThe selected function has no published version.
No rolesNo role is ticked, so nobody can run the action.
DisabledThe action is ready but turned off. It doesn't appear in menus.
EnabledThe action appears in the menu for people who are allowed to run it.

Who can run an action​

A person sees an action in the Quick Actions menu when all of these hold:

  • The action is Enabled.
  • They hold at least one of the roles ticked under Who can run it.
  • They can read the identity, or view the request, they are looking at.

Access is by role only. You can't allow an action for one identity or one request and not another. Owlie checks all three again when the action runs, and also that the function still has a published version.

People who can manage custom actions also get edit and delete controls beside each action in the menu.

Collect input with a form​

Under Action form, select Add form to ask for input before the action runs. The builder is the one used for resource forms, without file uploads and entitlement pickers. An action form holds at most 20 elements. Remove form deletes it.

Dropdowns, radio groups and toggle groups use the same Options source control as resource forms. Choose Define here for local options or select a shared choice list. A list can serve several actions, resource forms and eligible identity attributes.

The function receives the entered values as context.formData, keyed by field name. Without a form, context.formData is null. Owlie validates a submission against the saved form before it runs the function: unknown fields, invalid values and submissions larger than 128 KiB are rejected.

Owlie checks current choices when someone runs the action. A choice retired before the submission is accepted must be replaced with an active choice. Retirement after acceptance doesn't cancel a function call already accepted for execution.

Presentation and safeguards​

ControlDefaultEffect
IconZapThe icon beside the label in the menu.
Menu position0Lower numbers appear first.
EnabledOffOff hides the action without deleting it.
DestructiveOffShows the action in danger styling.
Require confirmationOnAsks the person to confirm before the function runs, for example "Run “Resync from HRIS” against Priya Raman?"

With a form and Require confirmation both set, the person fills in the form, selects Continue, and then confirms. Canceling at either point runs nothing.

What the function receives and returns​

Owlie builds the function's context on the server for each run, so the function can trust it:

  • context.actor: who ran the action, with their identity ID, email, display name and role slugs.
  • context.action: the action's ID, slug and label.
  • context.entityType: identity or request.
  • context.formData: the validated form values, or null.

The function's first argument is the identity or the request the action ran against. The exact shapes are in the function programming reference.

What the function returns decides what the person sees:

Returned fieldEffect in the dashboard
messageA notice with the message text, at the level success, info, warn or error.
refresh: trueThe identity or request page reloads its data.
navigate: { to }The dashboard opens the destination. A link outside Owlie opens in a new tab.
{}A "Done" notice.

Return an object every time, {} when there is nothing to show. A function that returns nothing fails the run, even though its work has already happened.

Message text is shown as plain text. Markup in it isn't rendered. A destination Owlie considers unsafe is ignored.

When an action fails​

If the function fails, the person sees "Label failed" with the reason. When the action has a form, the form stays open with the entered values so the person can correct them and try again. Trying again is a new run and checks current form choices again.

Every run is recorded in the function's execution history, on the History tab of the function editor. For an action with choice fields, the run's Submitted choices tab shows the labels that were chosen, including for options defined in the form. Renaming a label later doesn't rewrite the labels recorded for that run. Access to execution history follows the function permissions.

Delete a custom action​

On the action's page, Delete custom action removes it from every Quick Actions menu. It can't be undone. The function is left as it is. Deleting a function deletes the custom actions bound to it.