November 5, 2024

RSS was pronounced dead so many times that I lost count, but it’s still around and healthy. RSS provides us with a fantastic opportunity for automation since it has a defined structure and many services support it, like Power Automate. The “when a feed item is published” trigger helps us get new posts when they are published.

I wrote an article about using this trigger to publish news from an RSS feed on modern SharePoint sites.

Let’s explore it a bit further.

Where to find it?

You can find it in the RSS section.

Select “when a feed item is published.”

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

There are two parameters that you need to consider.

  1. The URL
  2. The “new” property.

The URL is where the feed lives and is fetched for content. The other property is “Chosen property will be used to determine which items are new.” A mouthful, I know, but this comes from the way RSS works. Although the reference has a field for an item ID and an URL, both may be changed by the site generating the feed. So, the flow needs to have a way to know when there’s a new article in the feed so that it can provide you with the information.

PublishDate vs. UpdatedOn

The Flow won’t trigger for updated fields if you pick the “PublishDate.” But if you choose “UpdatedOn” and there are many updates, you’ll get many triggers. So you must know what you want to get. If you’re going to get only new items and ignore the updates, then the “PublishDate” is the one to go. But if you want to update an article, if there’s a change, you need to prepare your Flow to do updates and not only inserts. It can be tricky because not always there’s a unique ID to do so. Also, some sites change the URL when they change something, so please be aware of this if you’re using the URL as your key.

To summarise:

  1. PublishDate if you want to get only new articles. Your Flow only deals with inserts, but changes to the articles will be ignored.
  2. UpdatedOn if you want to get the new articles and updates. Your Flow is more complex since it needs to take care of the updates, but you’ll get all new items and changes.

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": {
        "Pragma": "no-cache",
        "Transfer-Encoding": "chunked",
        "Retry-After": "1800",
        "Vary": "Accept-Encoding",
        "x-ms-request-id": "3025ae46-6337-4137-b33b-b50031f6e6d4",
        "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
        "X-Content-Type-Options": "nosniff",
        "X-Frame-Options": "DENY",
        "Cache-Control": "no-store, no-cache",
        "Location": "<redacted>",
        "Set-Cookie": "<redacted>",
        "Timing-Allow-Origin": "*",
        "x-ms-apihub-cached-response": "false",
        "Date": "Wed, 14 Jul 2021 12:06:04 GMT",
        "Content-Type": "application/json",
        "Expires": "-1",
        "Content-Length": "1145"
    },
    "body": {
        "id": "https://manueltgomes.com/?p=256675",
        "title": "Power Automate: Send an email notification Action",
        "primaryLink": "https://manueltgomes.com/reference/power-automate-action-reference/send-an-email-notification-action/",
        "links": [
            "https://manueltgomes.com/reference/power-automate-action-reference/send-an-email-notification-action/"
        ],
        "updatedOn": "0001-01-01 00:00:00Z",
        "publishDate": "2021-07-14 12:00:35Z",
        "summary": "<p>There are multiple areas where the send email notification action is useful, but I want to highlight the following: Dealing with errors &#8211; aside from &#8230; </p>\n<p>The post <a rel=\"follow noopener noreferrer\" href=\"https://manueltgomes.com/reference/power-automate-action-reference/send-an-email-notification-action/\" data-wpel-link=\"internal\" target=\"_self\">Power Automate: Send an email notification Action</a> appeared first on <a rel=\"follow noopener noreferrer\" href=\"https://manueltgomes.com\" data-wpel-link=\"internal\" target=\"_self\">Manuel T. Gomes</a>.</p>\n",
        "copyright": "",
        "categories": [
            "Microsoft",
            "Power Automate",
            "Power Automate Action Reference",
            "Reference",
            "Fundamentals"
        ]
    }
}
{
    "mode": "full",
    "isActive": false
}

Limitations

The “when a feed item is published” trigger only supports public feeds. There’s no option for authentication.

Some feeds follow the Atom standard. Both are XML, and sometimes they are mentioned interchangeably, but they are not the same.

Although the RSS format is well-defined, there are feeds that mix and match each element, so some feeds may not work as intended.

Recommendations

Here are some things to keep in mind.

Name it correctly

The name is super important in this case since we’re getting a feed from somewhere, and it should be clear from the start. 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 to avoid mistakes. Indicate what you’re trying to get and why. Also, it’s important to indicate, if you choose “UpdatedOn” instead of “PublishDate” (the default value), why you chose it. Finally, it’s important to enable faster debugging when something goes wrong.

Test the feed for a while before publishing it

Since feeds can be quite error-prone, testing is essential. Therefore, store the feed values for a while before you use them in any production environment. This way, you will check if some elements or items don’t have the values you expect and deal with them accordingly before propagating that information to the systems and users.

Back to the Power Automate Trigger Reference.

Photo by Nijwam Swargiary on Unsplash

Manuel Gomes

I have 18 years of experience in automation, project management, and development. In addition to that, I have been writing for this website for over 3 years now, providing readers with valuable insights and information. I hope my expertise allows me to create compelling, informative content that resonates with the audience.

View all posts by Manuel Gomes →

One thought on “Power Automate: When a feed item is published Trigger

  1. Hi,

    I’m using RSS – When a feed item is published and Teams – Post a message in a chat or channel but the problem there is always a delay when the message is received in Power Automate. I tried both the PublishDate and UpdatedOn but is the same.

    For eg. a particular message I received have a “Date”: “Sat, 16 Sep 2023 10:29:05 GMT” in the header and in the body the “updatedOn”: “2023-09-16 10:17:55Z” and “publishDate”: “2023-09-16 10:17:55Z” where there is a delay of 12 mins

    Any idea how to fix this?

Leave a Reply

Your email address will not be published. Required fields are marked *

Mastodon