List Actions
Custom buttons on the list command bar and in the item context menu: update items in one click, open a form, print, open a link, run Power Automate or a script, and open the form in a dialog from the list.
Overview
List actions are configured in the designer's List view tab. Unlike custom buttons (which live inside the form), actions appear in the list view: on the list command bar, in the item context menu (…), or in both. Actions reach SharePoint through the Command Set, which must be activated on the list (see Installation and Activation). A short summary is also in the Form Settings reference.
The Community edition lets you add 1 action, Pro up to 10 (the technical cap is 10 Command Set slots). Actions that are already saved keep working after a license change; forms never stop working. Limits are described in Licensing.
Your first action step by step
Example: an Approve button that sets Status to "Approved" on the selected items and asks for confirmation first.
- Open the designer from the list toolbar (form settings button) and go to the List view tab.
- Click Add list action and type "Approve" in the Button label field.
- Choose the list command bar as the Location and "1 or more items" as the Selection mode.
- Choose Update item fields as the Action type, add the Status field and the value "Approved".
- Turn on Require confirmation before running and fill in the title and message, for example "Approve {count} items?".
- Click Save form. When you close the designer, the list page reloads by itself and the button appears.
Location, icon, order and enabled
Every action has these common options, which apply to all action types.
- Location (
location): List command bar (commandBar, default), Item context menu (contextMenu) or both (both). An action that works on several items mostly makes sense on the command bar; in the context menu you work with the item you clicked. - Icon (
icon): an optional icon name shown next to the label. Without an icon only the text is shown. - Order (
order): actions are sorted by order; change it with the up and down arrows in the action list. At most 10 enabled actions fit into the Command Set manifest; any further ones are not shown. - Enabled (
enabled): you can keep a disabled action in the designer; it does not appear in the list and does not use a slot.
Selection mode
The Selection mode field (selectionMode) decides when the button is shown, based on the number of selected items. none (Always visible): the button is visible even with no selection, useful for actions that do not work with an item (open a link, run a Flow for the whole list). single (Exactly 1 item, default): the button is visible only when one item is selected. multiple (1 or more items): the button is visible from one selected item up and the action runs for all selected items.
The openForm and print actions always work with one item, so use single with them.
Visibility condition
An optional data visibility condition (visibilityCondition) hides the button when the selected item does not satisfy it. The condition is evaluated for every selected item separately and the button is shown only when all selected items satisfy it. With no selection, a button that has a condition is not shown.
- Syntax:
item.Status === 'New'or shorterStatus == 'New'; the internal column name followsitem.. - Operators:
===,==,!=,>,<,contains,startsWith. Combine conditions with&&(and) and||(or). - The condition only sees columns that are in the current list view. Add a column that is not in the view to the view.
- The condition is simple and does not execute code; for more complex logic use the runScript action.
{ "visibilityCondition": "item.Status === 'Pending approval' && item.Price > 1000" }
Confirmation
Turning on Require confirmation before running (confirmation.required) shows a dialog before the action. You can set the title, the message (supports {count} and {Title}), the confirm button text (confirmLabel) and the Cancel button text (cancelLabel); blank fields use the default texts in the form language. All action texts (label, confirmation) are translated on the Translations tab. We recommend a confirmation for every action that changes or sends data.
Action types
The action type (action.type) decides what happens on click. Each type has its own options.
Update item fields updateItem
Writes fixed values into the fields of all selected items without opening a form. Values are entered graphically (since 1.37.0): rows of field + value, where the value input matches the field type (choice, yes/no, number, date, person, text) as in the rules editor. The stored updateValues is an object of internal field name : value.
- Tokens: Token… inserts
@today(today's date),@now(current time),@me(signed-in user name) or@meId(their ID). The placeholder{Field}(for example{Title},{ID}) takes the column value of each selected item separately; the column must be in the view. Tokens are case-insensitive. - JSON: the JSON switch shows the text form. Values the grid cannot show (objects, arrays) can only be edited this way. The designer rejects invalid internal field names.
- Multiple items: with several selected items the write runs in batches of 5 items. If some items fail (for example a missing permission), the action still writes the others and the message reports the number of successful and failed items. After a successful write the list refreshes.
{ "action": { "type": "updateItem", "updateValues": { "Status": "Approved", "ApprovedById": "@meId", "ApprovalDate": "@today" } } }
Open form in dialog openForm
Opens the form of the selected item in a dialog over the list. The Form mode option (openFormMode) is Edit (edit, default) or Display (display). The optional Initial tab ID (openFormTabId) opens the form straight on the chosen tab, which suits an "Approval" action that should show only the decision tab. The dialog title shows the item title (the Title column, otherwise the action title). The dialog closes with the X or with the form's Close and Save buttons, and the list refreshes after a save. The action works with one item (selection mode single).
Print item print
Opens the form of the selected item in display mode with printing prepared. By default it opens in a dialog over the list. Turning on Open print in a new window (printDirectly) opens a new browser tab instead of the dialog. When printing, all visible tabs are printed stacked, sections are expanded and fields hidden by rules are not printed (the same as the form's Print button, see showPrintButton). The action works with one item.
Open URL openUrl
Opens an address built from the URL template (urlTemplate). The template can use placeholders in curly braces; their values are URL-encoded automatically.
{Field}: the column value (internal name) of the first selected item, for example{ID},{Title}.{count}: the number of selected items.{userEmail}and{userName}: the e-mail and name of the signed-in user.- Allowed are
httpandhttpsaddresses and relative addresses starting with/on the same domain. Addresses starting with//and other schemes are blocked and an invalid-address error is shown. - Target (
target): New tab (_blank, default) or Same window (_self).
{ "action": { "type": "openUrl", "urlTemplate": "/sites/portal/SitePages/Detail.aspx?id={ID}&by={userEmail}", "target": "_self" } }
Trigger Power Automate triggerFlow
Sends the selected items with an HTTP POST to the webhook of a Power Automate flow. Useful for approvals, notifications, document generation and other processes that should not run in the browser.
Setting up the flow in Power Automate
- In Power Automate create an automated cloud flow with the When an HTTP request is received trigger.
- Paste the schema below into Request Body JSON Schema (or use Use sample payload to generate schema). The
itemsarray contains only the columns selected in the action. - Save the flow. The trigger generates an HTTP POST URL; copy it and paste it into the Webhook URL field of the action (
flowWebhookUrl). - In the Payload fields field (
triggerFlowFields) enter internal column names separated by commas.IDis always sent; with no entry,Titleis sent besidesID. - In the flow, re-fetch the item from SharePoint by ID (Get item) and verify its state and permissions; treat data from the browser as untrusted.
The request body looks like this:
{
"listId": "5f0c...-guid",
"listTitle": "Requests",
"siteUrl": "https://contoso.sharepoint.com/sites/portal",
"itemIds": [12, 15],
"items": [ { "ID": 12, "Title": "Laptop purchase" }, { "ID": 15, "Title": "Training" } ]
}
{
"type": "object",
"properties": {
"listId": { "type": "string" },
"listTitle": { "type": "string" },
"siteUrl": { "type": "string" },
"itemIds": { "type": "array", "items": { "type": "integer" } },
"items": { "type": "array", "items": { "type": "object" } }
}
}
- Allowed addresses: the webhook must use
https://and the domain*.logic.azure.com,*.powerplatform.comor*.api.powerplatform.com. Any other address is blocked. - Response: an HTTP 2xx status counts as success (a message says the flow was started). Any other code (for example 400, 401, 404) is reported as an error with the code. The flow does not have to finish, it is enough that the trigger accepts the request (for long flows add a Response action at the start).
The form configuration, including the webhook URL with its sig= parameter, is stored in a file readable by list readers. Anyone with read access can learn the address and call the flow, so the flow must not trust the request body and must re-fetch the item by ID.
Run script runScript
Runs your own JavaScript (scriptCode) over the selected items. The script is an asynchronous function that receives a ctx object with these members: items (the selected items), listId, listTitle, siteUrl, user (id, title, email, loginName), locale, refresh() (refreshes the list view) and notify(message, intent) (shows a message; the intent is info, success, warning or error). General rules for writing scripts are in the Scripts chapter; a list action script, however, has no access to form fields.
Script policy: scripts are disabled by default and the tenant administrator enables them (see Script Policy). Until the policy allows scripts, the runScript action does not run and shows a message that scripts are blocked. A strict CSP (unsafe-eval) also blocks the script and reports it.
const ids = ctx.items.map(function (i) { return i.ID; });
ctx.notify("Selected items: " + ids.length, "info");
ctx.refresh();
Opening the form in a dialog from the list
SharePoint ignores the panel setting of custom forms (Microsoft bug sp-dev-docs#10996), so New and Edit from the list open a full form page. Since 1.32.0 you can turn on our own commands that open the form in a dialog over the list. The options are in the last section of the List view tab (Opening the form in a dialog); it is collapsed by default and its header shows a summary of the enabled options and a warning icon when action is needed. A summary is also in the listViewDialog reference.
New in a dialog newInDialog
A New button is added to the list command bar (only for users who can add items). It opens the New form (default content type, current folder) in a dialog titled "New item". After saving, the dialog closes and the list refreshes; if refresh is not available, the page reloads.
Open and edit in a dialog editInDialog
For exactly one selected item, the commands Open in dialog and Edit in dialog are added to the command bar and the context menu (edit only with edit permission). The dialog title is the item title. After saving, the dialog closes and the list refreshes.
Clicking the title opens the dialog openOnTitleClick
Since version 1.132.0: clicking an item title in the list view opens the form (display) in a dialog over the list instead of the full page. The row gets selected, the same as with the Open in dialog command. Ctrl+click, Shift+click and the middle button still open the form page (new tab), and Enter on the title works like a click. The option applies to lists, not document libraries (the title opens the file there), and only in the list view (not in gallery, board or grid editing).
The feature relies on internal markers of the Microsoft Lists view. If Microsoft changes them, FormCraft does not intercept the click and the standard form page opens; nothing breaks.
Built-in New opens the dialog replaceDefaultNew
Since version 1.133.0: the standard New button on the list command bar opens the new form in a dialog over the list instead of the full page, so users keep one familiar button. Unlike hiding the built-in New, view settings are not changed, so the option also works for lists synced offline and takes effect once the form is saved. If the list has several content types (New is a menu), the standard behavior stays.
Built-in Edit opens the dialog replaceDefaultEdit
Since version 1.133.0: the standard Edit on the command bar and in the row … menu opens editing of the selected item in a dialog. It applies to one selected item only; with several items selected, SharePoint bulk edit stays. View settings are not changed. As with clicking the title, the feature relies on internal markers of Microsoft Lists; if Microsoft changes them, the standard page opens and nothing breaks.
Hide the built-in New hideDefaultNew
Hides the built-in New button through view formatting (commandBarProps, command new) in all public views of the list, so users do not see two buttons. Existing view formatting is kept; the views where FormCraft added the entry are remembered in hiddenNewViewIds and only those are reverted when you turn the option off. The view change is written immediately when you toggle the switch (not when you save the form) and requires the permission to manage the list.
Hide the built-in Edit hideDefaultEdit
Hides the built-in Edit command (opens the edit form of the selected item; key edit) the same way as New; the views are tracked in hiddenEditViewIds. Quick edit in the grid stays. Turn it on together with editInDialog, otherwise users cannot edit an item from the list.
Requirements, limitations and how to revert
- Offline sync: the built-in New can only be hidden when the list is excluded from offline sync (Microsoft Lists sync). For a list available offline the form commands may not load and New would disappear completely. In that case the designer disables the switch and shows the reason; the warning on the same tab offers an Exclude the list from sync button.
- Page reload: after saving the configuration in a designer opened from the list toolbar, the page reloads by itself when you close it so the commands and hidden buttons take effect.
- Panel or window: since version 1.134.0 a form with the Panel layout (form appearance settings, or a custom mode layout) opens as a side panel on the right; other layouts open as a centered window. The list stays visible under the dimmed background.
- Speed: the dialog loads the whole form page in an iframe, so it is slower than a native panel. Clicking the item title in the list opens the dialog only with the openOnTitleClick option on, the built-in New and Edit only with replaceDefaultNew and replaceDefaultEdit, otherwise the page.
- How to revert: turn off Hide the built-in New and Hide the built-in Edit; FormCraft removes from the saved views only the entries it added itself. Turning off New in a dialog and Open and edit in a dialog removes our commands. Once Microsoft fixes the bug, we will switch to the native panel.
- Permissions: writing to views requires the permission to manage the list, see Administration: Permissions.
When a button does not appear
- Check that the FormCraft form and the Command Set are activated on the list (see Installation and Activation) and that the action is enabled.
- Check the Selection mode and the Visibility condition: the button is hidden when the number of selected items or the column values do not match.
- For a list available offline (Microsoft Lists sync) the buttons may not load; exclude the list from sync.
- More procedures are in Troubleshooting.