Table of contents
What are Triggered Actions?
Triggered Actions allow configuring actions that are applied to a list or library when an event occurs (add, update or add/update) and some condition evaluates to 'true'. Triggered Actions is a SharePoint Online exclusive feature.
Key features:
- Execute actions on trigger: Item Added, Item Updated, Item Added & Updated, Folder Added, HTTP Request
- e.g. send email notifications or update items when some event occurs
- Serial execution of multiple actions
- Define execution condition on each action
- Use FieldName.isChanged placeholder to execute Triggered Action only if field value is changed
Configuration UI
Triggered Actions can be found on the 'Things in Background' tab. Configure like a rule to plan automated executions with actions from a set of powerful action types.
Triggered Actions feature works only when item versioning is enabled.
Clicking the 'Add Triggered Action' button leads to opening the Triggered Action wizard.
The first step you'll see is the Details step
Note: Triggered Actions are created for the current list
Proceeding to the next wizard step Triggers, you can configure item event trigger of the action.
- Item Added - actions will be executed if item is added to the list or document file is uploaded to the library
- Item Updated - actions will be executed if item updated and version of item or file is increased.
- Item Added & Updated - actions will be executed if item/file is added as well if item is updated and version is increased.
- Folder Added - actions will be executed if folder is created on the list or library
- HTTP Request - action will be execute if HTTP request is send to the specified URL
Note: Triggered Actions will be executed as many times as many updates were made on the item
The next step Actions lets you configure actions. Clicking 'Configure Actions' button will open Action Builder.
Clicking 'Finish' button on the Overview step will create Triggered Action.
In the History tab you can see execution history of the Scheduled Action. 'Export history' button allows you to send history to .txt file.
By default, all Background Features executions: Aggregation, Metadata Inheritance, Calculated Expressions, Scheduled Actions, and Triggered Actions - don't activate triggered action execution.
In this case there is an option ‘Execute triggered actions’ which allows execution of triggered actions by current calculated value configuration.
Note: This option is visible on UI only if versioning is enabled.
The best practice is to use it together with a condition on field change in triggered action configuration. It allows to reduce unneeded executions.
For this we implemented the [[FieldName.isChanged]] placeholders for each field that return true/false value.
HTTP Request trigger type configuration
HTTP Request trigger type allows you to execute one or more actions when HTTP request is send to the specified URL. To configure HTTP Request trigger type:
- In the Triggers step of the wizard, select HTTP Request type.
-
Once HTTP Request trigger type is selected, system automatically generates the URL and API key needed for HTTP request. API key provides the basis for HTTP authorization in Triggered actions with HTTP Request trigger type. API key can be used in the URL with parameter called code or specified in x-trigger-key header value of the request.
If necessary, API key request can be renewed.
When the HTTP Request trigger is configured, an HTTP Trigger action is added automatically in the Actions step. This action populates output values based on the data received in the HTTP request. These outputs can be used in subsequent actions.
Available output values you can use in further actions:
| Output parameter | Type | Description |
| RequestHeaders | String | Returns HTTP request headers. To get the header from the request use a format: [[@Actions.HTTP_Trigger.RequestHeaders]]["HeaderName"] |
| RequestBody | String | Returns the original request body |
| RequestBodyJSON | JSON | Returns request body in JSON format |
| RequestFiles | String |
Returns an array of file objects came with the request. You can retrieve the following properties of the file:
Examples: |
If your HTTP request includes files, use the Store File action to retrieve and process the files received from the request:
To configure an HTTP request from an external system, please refer to the article that provides detailed, step-by-step instructions on how to make an HTTP request.
Background features loop handling
Complex background features configurations have many risks of creating loops, especially when ‘Execute triggered actions’ option is enabled for some calculated values.
To foresee this, we implemented a loop detection functionality that is executed whenever the background feature configuration is saved. You are prevented from saving such a configuration, but we are providing information about the loop source.
In most cases it can be resolved by one of the following actions:
- Disabling 'Execute triggered actions' option for calculated value (only when versioning is enabled)
- Changing lists/columns for calculated value configurations
- Changing trigger type and/or actions for the triggered actions
When the configuration is changed and there is no loop threat anymore, the configuration can be saved.
Triggered Actions on deployment
For the case if Triggered Action throwing an error continuously (i.e. list is deleted), Triggered Action will be deactivated. In this case you need to click on 'Reactivate execution' button in Deployment Maintenance tab for selected deployment in order to reactivate Triggered Action.
In order to open History logs you need to click on your Triggered Action (i.e. create onboarding tasks).
HTTP Request trigger type maintenance
If the Triggered Action uses the HTTP Request trigger type, the URL and API key required to trigger the deployed Triggered Action you can find in the Publish tab under Deployment Maintenance:
NOTE: Further updates in Triggered Action except changes in Triggered Action title will not change URL and API key parameters on the target site.