September 24, 2021

RSS was pronounced dead so many times that I lost count, but it’s still around and healthy. RSS provides us an amazing opportunity for automation since it has a defined structure and many services support it, like Power Automate, for example. 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 in the main screen, so check there before going trough the full hierarchy. Also you can use the search to quickly find it.

Usage

There are two parameters that you need to consider.

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

The URL is the place 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 that is 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 be getting a lot of triggers. So you must know what you want to get. If you want 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, when they change something, some sites change the URL, 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.

Am I missing something? Leave a comment or interact on Twitter. Let’s work together to make this reference as complete as we can

Back to the Power Automate Trigger Reference.

Photo by Nijwam Swargiary on Unsplash

Manuel Gomes

I'm a Project Manager with experience in large projects and companies. I've worked in the past for companies like Bayer, Sybase (now SAP) and I'm currently working for Pestana Hotel Group.

View all posts by Manuel Gomes →

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: