Nintex Workflow – RSS Parsing
RSS or Rich Site Summary has been around for many years now. It’s still used now as a way to summarize and distribute new updates to sites, and present news.
Since RSS is a simple XML format, parsing that data isn’t really that hard. It can be easily done with Nintex Workflow.
As you can see from the workflow design below, it’s quite easy to put together.
What actions are used?
The first action in this workflow is a Build String because I simply pasted my RSS feed into it and stored it in a text variable. Ideally, you would look at using the Web Request action, configured to do a GET and store the RSS feed in the variable that way. Then you can schedule this type of workflow to parse out the information you need.
Query XML – initially used to get the count of the number of RSS items in the feed. Also used to get the RSS item titles, descriptions and urls. Good information to use if you’re putting together a report.
For Each – iterate through each value in the Title collection to parse through each item.
Collection Operation – used to extract the corresponding Description and Url that match the title we have.
Action Set – used to group the Collection Operation actions so we can hide this from the rest of the workflow design, to make the design more visually appealing.
Log in the History List – used as more of a debugging action. We log each Title, Description and Url to the workflow history. This would be replaced with real business logic.
The Magic
The Query XML actions are really the heart of this workflow, since RSS is basically XML.
We use this action in 2 different ways. The first time we use, we are simply getting the count of the number of RSS items in the feed. This is achieved with XSLT.
This is more of a housekeeping thing. I like to eventually add some validation that we have some items in the RSS feed before we try to parse them.
Our next Query XML action is pulling out each RSS Item Title and storing it in a Collection variable. It is doing the same for the Description and the URL.
To do that, we use XPath for each of the fields we want to pull out.
Finally, we go through each value using the For Each action :
You can see how I’m pointing to the Index as each time through the For Each, I’m storing it in a number variable. This allows me to use it in the Collection Operation actions later in the workflow to get the corresponding values from the other colleciton variables.
We have a couple of the Collection Operation actions and that gives you an idea of how we use the “index” that we stored from the For Each action.
That’s all there is to this workflow. Below, you can download it. It is a Nintex Workflow 2013 workflow.
Downloads
Nintex Workflow 2013 – v3.0.3.0
RSS Parsing Workflow – Download and import it into the Workflow Designer Page