Vue normale

Il y a de nouveaux articles disponibles, cliquez pour rafraîchir la page.
À partir d’avant-hierFlux principal

Power Automate: Office 365 Outlook – When a new email mentioning me arrives Trigger

I’ve mentioned this many times, but sorting email is where productivity dies, even if you have a quick way to do it. There’s nothing better than having Power Automate doing all the work for you, so today, we’ll explore the “when a new email mentioning me arrives” trigger for Office 365.

Let’s see how to use it and how to find it.

Where to find it?

To find it, you can search for the “When a new email mentioning me arrives” trigger or go to the “Office 365 Outlook”:

Select “When a new email mentioning me arrives”:

Here’s what it looks like:

There are advanced options that we’ll explore below, but here’s how to activate them:

Here’s the advanced view.

Pro Tip:
Power Automate tends to save the most common triggers on the main screen, so check there before going through the full hierarchy. Also, you can use the search to find it quickly.

Let’s check the “advanced” fields since they allow us to filter emails we don’t want to process.

Fields

There are a lot of fields that we can configure. Let’s look at them individually.

Folder

If you leave it blank, Power Automate will look at all incoming emails, but you can define different folders to trigger instead of the inbox. For example, you may have a folder where you send a pre-defined answer to the person that emails you while mentioning you or send you a notification when this happens. The folder is a great way to limit catching all emails that arrive mentioning you so that the Flow doesn’t fire for all emails, so be sure to define it if possible.

“To”, “CC”, “To or CC,” or “From”

These fields were a great idea from Microsoft when creating this trigger. Since we receive many emails, it doesn’t make sense for the trigger to fire each time we receive an email mentioning us. For example, we may only want a subset of the total emails or emails from specific co-workers. With these filters, we don’t need to add large “Condition” or “Switch” actions to filter the emails you want. The trigger does all the work for you.

Just so you know, the trigger will run only if at least one matches, so this is also good if you have substantial limitations on the number of Flows you can run a day.

To use it, separate the emails with “;”. You can have internal and external emails, but keep this field with only the email. When you copy emails from some email clients, you’ll have the name associated with it, so be sure to remove it.

Finally, I want to highlight the “To or CC” field. If you add an email to the “To” field or the “CC” field, the email must contain both for the Flow to trigger. But if you want either one, you can use the “To or CC” field.

Importance

The “importance” field is often ignored, but some organizations can have strict rules on how to use it. If yours is one of them, you can have a Flow that sends you a notification each time a “High” priority email arrives, for example. The available possibilities are:

  1. Any
  2. High
  3. Normal
  4. Low

Only with Attachments

For example, if you have a Flow that archives your attachments automatically, you may want to trigger Flows that have them. Having your Flow trigger only when a condition is satisfied makes your life easier because you don’t need to validate, for each email that arrives, if there’s an attachment or not.

Include Attachments

Should the trigger include the attachment information or not? There is, however, something that you should know. Even if you enable this feature, Flow (at the time of writing this article) won’t fetch the attachments correctly. I go into detail in this article, but you need to know that you need to fetch the articles separately using the “Get email” action.

Subject Filter

As with the other fields, we can filter the subject for a specific string, and the Flow will only trigger if that condition is met.

Usage

It’s essential to define what is an email “arriving”. It doesn’t need to be a new email or an email that drops in the inbox. We consider it as “arriving” any email that is moved to a folder, being automatically when it arrives in your inbox, or you move it to another folder. This is super important because it opens the doors to a lot of automation based on moving emails to folders.

This trigger will fire if the emails mention you in the body, so you’ll have access to all properties of that email in the following actions. For example, here’s how to access the email’s subject using a “Compose” action.

Notice that you don’t need to use the “Apply to each” action because you only have one email each time, meaning that if you receive multiple emails where you’re mentioned, your Flow will trigger once per email received.

Please remember that a mention is not the same as having your name. For example, if I write the following email, it won’t be considered a mention.

But the following is:

You need to use the “@“ character to display several suggestions that can be people from this email. Please be careful because some email clients will automatically add the email to the list of senders if it’s mentioned, so be sure you want that person to receive the email.

Limitations

You can’t access emails in shared libraries. You can use the “When a new email arrives in a shared mailbox” trigger to catch emails, but then you need to check int email’s body to see if there’s a mention of you manually.

Also, some emails, like protected emails, could be skipped depending on your tenant configurations. If there’s any issue in the attachments or body of the email, the “When a new email mentioning me arrives” won’t trigger as well.

Recommendations

Here are some things to keep in mind.

Use the filters wisely

Using the filter fields is a fantastic way to trigger your Flow when the condition is met, limiting the number of times the Flow fires. But it’s important to know that the flow triggers only if all filters are met. Test your triggers and ensure they are firing when you want them. Any email that should be parsed but doesn’t fit the filters will be ignored, so it’s a hidden error since there are no error messages or warnings.

Name it correctly

The name is super important in this case since there are a lot of filters. Define in the name what you’re trying to achieve. Always build the name so that other people can understand what you are using without opening the action and checking the details.

Always add a comment

Adding a comment will also help avoid mistakes. Indicate what emails you want to fetch, the ones to ignore the exceptions, and the reasoning behind that. It’s essential to enable faster debugging when something goes wrong. Besides, it’s good to understand the mindset and requirements when building the Flow in case someone else is debugging or improving it.

Back to the Power Automate Trigger Reference.

Photo by Melinda Gimpel on Unsplash

 

Power Automate: OneDrive for Business – For a selected file Trigger

Did you know you can trigger Flows for files directly in OneDrive for Business? Let’s say that you have a contract that you want to send for approval. You need to generate a link to the file or attach it to an email, send it to the people who need to approve it, receive notifications, and merge changes. Or you press a button and let Power Automate do the work for you by using OneDrive for Business “For a selected file” trigger that catches these requests.

Let’s see how to use it.

Where to find it?

To find it, you can search for OneDrive for Business “For a selected file” trigger or select “Standard”.

Select “OneDrive for Business”:

Pick OneDrive for Business “For a selected file” trigger:

Here’s what it looks like:

Pro Tip:
Power Automate tends to save the most common triggers on the main screen, so check there before going through the full hierarchy. Also, you can use the search to find it quickly.

There are no fields to configure, so let’s look at how to use it.

Usage

First, let’s create a Flow called “Approve Contract” (the name will be important later).

Now that we have a Flow with OneDrive for Business “For a selected file” trigger, let’s go to our OneDrive and see how to trigger the automation:

OneDrive for Business did all the work in the backend, and it’s already displaying the Flow for us to run.

When you run, if it’s the first time, you may need to configure/confirm the connections.

After this, the Flow will trigger on Power Automate.

Outputs

The trigger returns a lot of information in a JSON format, although the conversion from JSON is done automatically for you. Here’s an example:

{
    "headers": {
        ...
    },
    "body": {
        "entity": {
            "filePath": "/TMP/Test File11.xlsx",
            "fileUrl": "https://manueltgomescom-my.sharepoint.com/personal/manuel_manueltgomes_com/_layouts/15/Doc.aspx?sourcedoc=%7B5f82b4aa-827d-4c7d-b607-963b0542e7f7%7D&action=default&uid=%7B5f82b4aa-827d-4c7d-b607-963b0542e7f7%7D&ListItemId=372689&ListId=7B5f82b4aa-827d-4c7d-b607-963b0542e7f7&odsp=1&env=prod",
            "ID": 372689,
            "itemUrl": "https://manueltgomescom-my.sharepoint.com/personal/manuel_manueltgomes_com/_layouts/15/Doc.aspx?sourcedoc=%7B5f82b4aa-827d-4c7d-b607-963b0542e7f7%7D&action=default&uid=%7B5f82b4aa-827d-4c7d-b607-963b0542e7f7%7D&ListItemId=372689&ListId=8e3fcb4a-4b52-4790-a96b-89f9e426aa90&odsp=1&env=prod",
            "fileName": "Test File11.xlsx",
            "FileId": "372689"
        }
    }
}

Notice that we only got the information about the file, not the file itself. Other triggers like OneDrive for Business “When a file is created Trigger”, for example, will return the file information we can use. Still, the OneDrive for Business “For a selected file” will return the file ID. We can then use that ID and the “Get File Content Action” action to get the file to parse.

Limitations

If you build the Flows in the “My Flows” section, only you will see them in OneDrive for Business. This is not a limitation per se, but it’s something that you should be aware of, but there’s no real impact since you’re triggering the Flow in files that are in your OneDrive for Business and not a shared place like SharePoint where multiple people have access to the same file.

Recommendations

Here are some things to keep in mind.

Don’t use this for synchronization

I see many questions regarding the synchronization of files. OneDrive for Business “For a selected file” trigger is an excellent target to catch files that need replication. But I would strongly advise you not to do it. Synchronization of files is an amazingly complex topic in computer science, and we are all super when something doesn’t synchronize properly. If the trigger fails, data will be out of sync, and Power Automate won’t rerun it. If the data is changed on the destination folder, you already have a problem that will only worsen over time.

Name it correctly

The name is super important since we need to provide context for what we will do with the file. Keeping the name “For a selected file” won’t give any helpful context. Always build the name so that other people can understand what you are using without opening the action and checking the details.

Additional contracts to the name

Since you’ll be seeing the flow’s name in OneDrive for Business, and it’s your only clue as to what it will do to the selected item, it’s essential o keep the names as straightforward as possible.

In this example, “Request sign-off” is not clear enough. Request sign-off of what? What will happen? Name it so that, even with only a few characters, people will know what happens when they trigger the automation.

Finally, this is the only exception I see to not using environment clues like “PROD” in the name, for example. Space is limited, so if the name is too long, it may be truncated.

Always add a comment

Adding a comment will also help avoid mistakes. Indicate what you’re expecting, why the Flow should be triggered, and what the data will be used. It’s essential to add comments when limiting the trigger with some custom rulessince these are not prominent in the UI, and people may get confused as to why the Flow doesn’t trigger when it’s simply a rule preventing it from doing so. It’s essential to enable faster debugging when something goes wrong.

Finally, let people know why you’re choosing the parameters you configured. For example, why do you select that folder if you have a folder defined? It may make sense now, but not in a few months.

An automated trigger is better than a scheduled one

Sometimes people are tempted to use scheduled triggers that pool the resources once in a while. This way, they can control when the information is fetched and save many Power Automate “triggers” if their quota is low. However, even if it isn’t, it may be more efficient to do batch tasks than once by one. I understand, and in some cases, I can agree, but it brings a lot of difficulties in the process. For example, you may need to keep track of what changed from the last run until this one so that some things may get lost. Also, you’re forcing something to happen periodically, even if there’s no data.

I always recommend using these “automatic” triggers instead, where they trigger one by one, but only when there’s data, so you’re always sure you get something to do. Also, debugging triggers that parse a single data point instead of multiple simultaneously is much easier. If something fails on one, then you can fix the Flow and repeat the process. But while parsing multiple ones, things can get a lot harder.

Back to the Power Automate Trigger Reference.

Photo by Priscilla Du Preez on Unsplash

Power Automate: SharePoint – For a selected file Trigger

Did you know you can trigger Flows for files directly in SharePoint? Let’s say that you have a contract that you want to send for approval. You need to generate a link to the file or attach it to an email, send it to the people who need to approve it, receive notifications, and merge changes. Or you press a button and let Power Automate do the work for you by using SharePoint “For a selected file” trigger that catches these requests.

Let’s see how to use it.

Where to find it?

To find it, you can search for SharePoint “For a selected file” trigger or select “Standard”:

Select “SharePoint”:

Pick “For a selected file” trigger:

Here’s what it looks like.

Pro Tip:
Power Automate tends to save the most common triggers on the main screen, so check there before going through the full hierarchy. Also, you can use the search to find it quickly.

Let’s see the fields that we need to configure.

Fields

There are a few fields to configure so that you can take advantage of them.

Site address

We need a place to search for changes, so we need to configure the site address. There’s no way to select “all sites,” but this is a broad search parameter since a site could already have a lot of activity. If you want more sites, you need to replicate the trigger to consider all the sites you need.

Library Name

Within sites, there are multiple libraries, so we need to indicate what library we want. As before, we cannot have an “all libraries” filter, so if you have a lot of libraries, you need to duplicate the trigger for all of them.

Usage

Now that we have the site and library name configured, let’s see how to use it. First, let’s create a Flow with a trigger named “Approve Contract” (the name will be important later).

Now that we have a Flow with SharePoint “For a selected” trigger, let’s go to the SharePoint document library and see how to trigger the automation.

SharePoint did all the work in the backend, and it’s already displaying the Flow for us to run. No configuration is needed on the SharePoint side.

When you run, if it’s the first time, you may need to configure/confirm the connections.

After this, the Flow will trigger on Power Automate.

Outputs

The trigger returns a lot of information in a JSON format, although the conversion from JSON is done automatically for you. Here’s an example:

{
    "headers": {
        ...
    },
    "body": {
        "entity": {
            "ID": 4,
            "itemUrl": "https://manueltgomescom.sharepoint.com/sites/Test/_layouts/15/Doc.aspx?sourcedoc=%7B5f82b4aa-827d-4c7d-b607-963b0542e7f7%7D&action=edit&uid=%3c139851-251a-4ee0-907f-24dcfd5c29c1%7D&ListItemId=4&ListId=%ed455c5b-349d-4c44-bc20-ec45ce49c417%7D&odsp=1&env=prod",
            "fileName": "Test Document.docx",
            "FileId": "4"
        }
    }
}

Notice that we only got the information about the file, not the file itself. Other triggers like SharePoint’s “When a file is created (properties only)” trigger, for example, will return the file metadata that we can use, but the SharePoint “For a selected file” will return the item ID. We can then use that ID and use the “Get File Metadata Action” action to get the file metadata for the file to parse.

Limitations

If you build the Flows in the “My Flows” section, only you will see them in SharePoint. This is not a limitation per se, but it’s something that you should be aware of. If you want other users to see the Flow, you need to share it with them like this:

Add the names or emails:

The Flow will not show in their SharePoint document library.

Recommendations

Here are some things to keep in mind.

Don’t use this for synchronization

I see many questions regarding synchronization between SharePoint document libraries, and SharePoint “For a selected file“ trigger is an excellent target to catch files that need replication. But I would strongly advise you not to do it. Synchronization of files is an amazingly complex topic in computer science, and we are all super when something doesn’t synchronize properly. If the trigger fails, data will be out of sync, and Power Automate won’t rerun it. If the data is changed on the destination folder, you already have a problem that will only worsen over time.

Name it correctly

The name is super important since we need to provide context for what we will do with the file. Keeping the name “For a selected file” won’t give any helpful context. Always build the name so that other people can understand what you are using without opening the action and checking the details.

Additional contracts to the name

Since you’ll be seeing the flow’s name in SharePoint, and it’s your only clue as to what it will do to the selected item, it’s essential o keep the names as straightforward as possible.

In this example, “Request sign-off” is not clear enough. Request sign-off of what? What will happen? Name it so that, even with only a few characters, people will know what happens when they trigger the automation.

Finally, this is the only exception to not using environment clues like “PROD” in the name. Space in SharePoint is limited; if the name is too long, it may be truncated.

Always add a comment

Adding a comment will also help avoid mistakes. Indicate what you’re expecting, why the Flow should be triggered, and what the data will be used. It’s essential to add comments when limiting the trigger with some custom rulessince these are not prominent in the UI, and people may get confused as to why the Flow doesn’t trigger when it’s simply a rule preventing it from doing so. It’s essential to enable faster debugging when something goes wrong.

Finally, let people know why you’re choosing the parameters you configured. For example, why do you select that folder if you have a folder defined? It may make sense now, but not in a few months.

An automated trigger is better than a scheduled one

Sometimes people are tempted to use scheduled triggers that pool the resources once in a while. This way, they can control when the information is fetched and save many Power Automate “triggers” if their quota is low. However, even if it isn’t, it may be more efficient to do batch tasks than once by one. I understand, and in some cases, I can agree, but it brings a lot of difficulties in the process. For example, you may need to keep track of what changed from the last run until this one so that some things may get lost. Also, you’re forcing something to happen periodically, even if there’s no data.

I always recommend using these “automatic” triggers instead, where they trigger one by one, but only when there’s data, so you’re always sure you get something to do. Also, debugging triggers that parse a single data point instead of multiple simultaneously is much easier. If something fails on one, then you can fix the Flow and repeat the process. But while parsing multiple ones, things can get a lot harder.

Back to the Power Automate Trigger Reference.

Photo by Brienne Hong on Unsplash

 

Power Automate: SharePoint – When an item or a file is modified Trigger

I have to admit that this is a strange trigger because it mixes items and files, and it doesn’t have a “when created” counterpart. It can be helpful depending on your workflow, so today, we’ll explore the “When an item or a file is modified” trigger and how to take advantage of it.

Where to find it?

To find it, search for the “When an item or a file is modified” trigger or go to “Standard”.

Select “SharePoint”.

Pick the “When an item or a file is modified” trigger.

Here’s what it looks like.

There are some advanced options that you can explore. To add them, press here:

Here’s what it looks like with the options expanded:

Pro Tip:
Power Automate tends to save the most common triggers in the main screen, so check there before going through the full hierarchy. Also, you can use the search to find it quickly.

Let’s look at the fields and how we can configure them.

Fields

There are a few fields to configure so that you can take advantage of them.

Site address

We need a place to search for changes, so we need to configure the site address. There’s no way to select “all sites,” but this is a broad search parameter since a site could already have a lot of activity. If you want more sites, you need to replicate the trigger to consider all the sites you need.

List or Library Name

Within sites, there are multiple libraries, so we need to indicate what library we want. As before, we cannot have an “all libraries” filter, so if you have a lot of libraries, you need to duplicate the trigger for all of them.

It will also display all the lists on the site; as for the document libraries, you cannot have an “all lists” choice.

Folder

This one is optional and should be used wisely. If we want to get changes from all files, by all means, keep it empty, but it’s always good to limit a bit the number of Flows that we trigger. If you can have the trigger look for folders down the line, it will help you:

  1. Having fewer exceptions to parse and reducing the number of folders also limits the number of types of files that you need to look at.
  2. Fewer triggers, meaning that you keep your Power Automate usage under control. Remember that triggers are not unlimited, so keeping them controlled will go a long way to avoid having limitation issues in the future.

Limit Columns by View

You can limit the columns that you want to be returned by defining a view in SharePoint, and by doing so, you can speed up your Flow because it will only return a smaller subset of data. But remember that it won’t consider any filters you have defined in the view. As the name indicates, it will only look at the columns in the view, not the data, so it will always return changes to files and items that may not be visible in your view.

Usage

Here’s an example of a document library I created, and we want to check changes to those files.

Since we leave the folder field empty, Power Automate will look at all files in the document library.

What is a modification?

But to understand when the trigger will fire, we need to understand what is a “modification”. A “modification” is when you change the data associated with the item’s metadata and not the file itself. Adding more text to a word file is not a change.

When you see a document library, you’ll notice that the folder structure looks much like the item structure, and that’s for a good reason. They are the same, but since they are different types, SharePoint displays them in a way that makes sense to the user.

Here’s an example of the document library in the example above:

We even have the “+ Add column” option as we have on the list item view.

This is because the document library is a view behind the scenes, meaning we can add additional items to a list, so let’s add a new column called “Status” to test.

Now let’s edit the value. When you’re a list item, you will click on the row, but since this is a file, it will open the file itself and not its properties. You need to do the following:

You’ll notice that we’re not touching the file. We’re not editing the file itself. We’re editing the list item, in this case, a file, because it’s a document library. And this is when the trigger will fire because there was a change to the file.

So the “When an item or a file is modified” trigger will fire when you edit the fields in the list regardless of their type (item or file). I know it’s not intuitive since we think modifying a file by editing it, but this is not how this trigger works.

If you select the folder ensure it is in the document library

Finally, be careful when selecting the folder in case you need it. When you choose a document library, the UI won’t filter the folder list to the ones inside that library and will always list for the site. For example:

Be sure to pick folders inside the document library because Power Automate won’t return an error. The Flow won’t fire because it’s impossible for the file to be in two folders simultaneously.

Outputs

The “When an item or a file is modified” trigger outputs depend on the parameters you pick. For example, in the case above, we have a column “Status”, so the trigger will return it:

But if we pick a list, the UI will adapt and provide the columns for that list.

Non-intuitive behaviors

I mentioned above, but the most non-intuitive behavior for the “When an item or a file is modified” trigger is that the files could be modified (for example, adding a new row in an Excel file). Still, the trigger won’t consider it as a “modification”. It will only consider modifications when you change the columns associated with that document library, as it was a “simple” list.

Limitations

You can’t pick “all document libraries”, so you always have to pick a list or a document library from the list. It’s not really a limitation since it’s a good compromise, but if you have multiple document libraries, you need to replicate the Flow for each document library.

Recommendations

Here are some things to keep in mind.

Don’t use this for synchronization

I see many questions regarding synchronization between SharePoint lists, and the “When an item or a file is modified“ trigger is an excellent target to catch items that need replication. But I would strongly advise you not to do it. Synchronization of items is an amazingly complex topic in computer science, and we are all super when something doesn’t synchronize properly. If the trigger fails, data will be out of sync, and Power Automate won’t rerun it. If the data is changed on the destination list, you already have a problem that will only worsen over time.

Name it correctly

The name is super important since the trigger has a lot of configurations. We should name it, so it’s clear what information we’re getting and why. Always build the name so that other people can understand what you are using without opening the action and checking the details.

Always add a comment

Adding a comment will also help avoid mistakes. Indicate what you’re expecting, why the Flow should be triggered, and what the data will be used. It’s essential to add comments when limiting the trigger with some custom rulessince these are not prominent in the UI, and people may get confused as to why the Flow doesn’t trigger when it’s simply a rule preventing it from doing so. It’s essential to enable faster debugging when something goes wrong.

Finally, let people know why you’re choosing the parameters you configured. For example, why do you select that folder if you have a folder defined? It may make sense now, but not in a few months.

An automated trigger is better than a scheduled one.

Sometimes people are tempted to use scheduled triggers that pool the resources once in a while. This way, they can control when the information is fetched and save much Power Automate “triggers” if their quota is low. However, even if it isn’t, it may be more efficient to do batch tasks than once by one. I understand, and in some cases, I can agree, but it brings a lot of difficulties in the process. For example, you may need to keep track of what changed from the last run until this one so that some things may get lost. Also, you’re forcing something to happen periodically, even if there’s no data.

I always recommend using these “automatic” triggers instead, where they trigger one by one, but only when there’s data, so you’re always sure you get something to do. Also, debugging triggers that parse a single data point instead of multiple simultaneously is much easier. If something fails on one, then you can fix the Flow and repeat the process. But while parsing multiple ones, things can get a lot harder.

Back to the Power Automate Trigger Reference.

Photo by Christopher Bill on Unsplash

 

Power Automate: SharePoint – When an item is deleted Trigger

SharePoint’s lists are excellent for keeping data, but one accidental delete could generate a lot of headaches, especially if you don’t notice it. That’s why Microsoft developed the “When an item is deleted” trigger, where you can define Flows that do actions when an item is deleted, like a notification to someone to check the “Recycle bin” and see if the item should have been deleted or not.

Let’s check how to take advantage of SharePoint’s “When an item is deleted” trigger.

Where to find it?

To find it, you can search for the “When an item is deleted” trigger or go to “Standard”:

Select “SharePoint”:

Pick the “When an item is deleted” trigger.

Here’s what it looks like.

Pro Tip:
Power Automate tends to save the most common triggers on the main screen, so check there before going through the full hierarchy. Also, you can use the search to find it quickly.

Usage

It’s pretty easy to configure. You select the site and the list you want to check, and that’s it. For example, if we want to check our “Test Users” list, we’ll do the following:

It will trigger as soon as an item is deleted, but I want to highlight the outputs of this trigger. It won’t return the elements of the item, so you won’t have access to all columns like in the “When an item is created or modified” trigger, for example. You will get the following information:

It makes sense to return this data since the trigger will fire after the item is deleted, so it won’t have access to its information. It will provide information about the deletion, like who deleted it and when.

Non-intuitive behaviors

As mentioned above, not returning all list elements could be considered a non-intuitive behavior. Still, there’s another one I would like to highlight concerning the data returned.

As you can see above, you have the “Is Folder” that is kind of strange on a list, right? We’re dealing with list items, not folders and files, but there’s the indication of “Is Folder”. This is because you can add folders to a list to organize your items. I go into a lot of detail here , so take a look if you want to learn how to use them.

Finally, there’s the possibility to configure SharePoint to keep all changes to the list items. If you don’t know how to do it, check my article on SharePoint’s best practices in the section “Versions”. We can take advantage of this version history and use the “Send an HTTP request to SharePoint “ action to get it. If you don’t know how to do it, here’s an article.

The issue with this is that you won’t be able to do it. You’ll get the following error message:

Item does not exist. It may have been deleted by another user.

Again, the trigger will fire after is deleted, so you won’t have access to its elements unless you manually restore it from the “Recycle Bin”. However, one could consider a “deletion” as a change to the item’s status and worth keeping a version mention of it, but I can understand why Microsoft chose this behavior.

Limitations

The “When an item is deleted” trigger can only be used by site collection admins of the site where the list is located, meaning that if you’re not a site admin, this trigger won’t fire, so keep this in mind in case you’re having issues with the trigger.

Recommendations

Here are some things to keep in mind.

Don’t use this for synchronization

I see many questions regarding synchronization between SharePoint lists, and the “When an item is deleted“ trigger could be an excellent target to catch items that need deleting. But I would strongly advise you not to do it. Synchronization of items is an amazingly complex topic in computer science, and we are all super when something doesn’t synchronize properly. If the trigger fails, data will be out of sync, and Power Automate won’t rerun it. If the data is changed on the destination list, you already have a problem that will only worsen over time.

Name it correctly

The name is super important since the trigger can be used on any list you can access. Always build the name so that other people can understand what you are using without opening the action and checking the details.

Always add a comment

Adding a comment will also help avoid mistakes. Indicate what you’re expecting, why the Flow should be triggered, and what the data will be used. It’s essential to add comments when limiting the trigger with some custom rulessince these are not prominent in the UI, and people may get confused as to why the Flow doesn’t trigger when it’s simply a rule preventing it from doing so. It’s essential to enable faster debugging when something goes wrong.

Finally, let people know why you’re choosing the parameters you configured. For example, why do you select that folder if you have a folder defined? It may make sense now, but not in a few months.

An automated trigger is better than a scheduled one

Sometimes people are tempted to use scheduled triggers that pool the resources once in a while. This way, they can control when the information is fetched and save much Power Automate “triggers” if their quota is low. However, even if it isn’t, it may be more efficient to do batch tasks than once by one. I understand, and in some cases, I can agree, but it brings a lot of difficulties in the process. For example, you may need to keep track of what changed from the last run until this one so that some things may get lost. Also, you’re forcing something to happen periodically, even if there’s no data.

I always recommend using these “automatic” triggers instead, where they trigger one by one, but only when there’s data, so you’re always sure you get something to do. Also, debugging triggers that parse a single data point instead of multiple simultaneously is much easier. If something fails on one, then you can fix the Flow and repeat the process. But while parsing multiple ones, things can get a lot harder.

Back to the Power Automate Trigger Reference.

Photo by Gareth Harper on Unsplash

❌
❌