{"id":230,"date":"2011-10-31T13:06:30","date_gmt":"2011-10-31T13:06:30","guid":{"rendered":"https:\/\/www.harepoint.com\/Blog\/?p=230"},"modified":"2019-03-22T11:40:09","modified_gmt":"2019-03-22T11:40:09","slug":"rss-in-sharepoint-workflow","status":"publish","type":"post","link":"https:\/\/www.harepoint.com\/Blog\/rss-in-sharepoint-workflow\/","title":{"rendered":"Publishing News from RSS feeds in SharePoint"},"content":{"rendered":"\n<ul><li><a href=\"#background\">Background<\/a>\n<li><a href=\"#creation\">Workflow creation<\/a>\n<li><a href=\"#scheduling\">Workflow scheduling<\/a>\n<li><a href=\"#conclusion\">Conclusion<\/a><\/ul><p>This example will show you how to get news from RSS feeds, publish them on a SharePoint website and how to run workflows automatically according to a schedule.<\/p><p>We will create a workflow that retrieves news from RSS feeds and publishes them in one of the lists on the website. This type of workflow cannot be created using only SharePoint own conditions and actions; therefore we will use several components from <a href=\"\/Products\/HarePointWorkflowExtensions\/Default.aspx\">HarePoint Workflow Extension<\/a>. Here is the list of components used:<\/p><table border=\"1\" cellpadding=\"5\" style=\"border-style: solid; border-collapse: collapse; border-spacing: 0px;\"><tbody>\n    <tr>\n        <td rowspan=\"2\"><b>Component name and type<\/b><\/td>\n        <td align=\"center\" colspan=\"2\"><b>Set of Workflow components<\/b><\/td>\n    <\/tr>\n    <tr>\n        <td align=\"center\"><b>SharePoint Workflow<\/b><\/td>\n        <td align=\"center\"><b>HarePoint Workflow Extensions<\/b><\/td>\n    <\/tr>\n    <tr>\n        <td>Fetch RSS Item (Action)<\/td>\n        <td><\/td>\n        <td align=\"center\"><img decoding=\"async\" src=\"\/Pictures\/Workflow\/yes.gif\"\/><\/td>\n    <\/tr>\n    <tr>\n        <td>Create List Item (Action)<br\/><\/td>\n        <td align=\"center\"><img decoding=\"async\" src=\"\/Pictures\/Workflow\/yes.gif\"\/><\/td>\n        <td><\/td>\n    <\/tr>\n    <tr>\n        <td>If any value equals value (Condition)<\/td>\n        <td align=\"center\"><img decoding=\"async\" src=\"\/Pictures\/Workflow\/yes.gif\"\/><\/td>\n        <td><\/td>\n    <\/tr>\n<\/tbody><\/table>\n\n<p>First, we will create a list of \u201cAnnouncements\u201d type (hereinafter referred to as the \u201cList\u201d), which our workflow works with, and we will put it on one of the site\u2019s web pages. Then we will create a workflow acting in the following manner:<\/p>\n<ol>\n<li>Retrieve the URL of an RSS feed out of the workflow parameters.<\/li>\n<li>Retrieve the first item with the title and the text of the news from the feed.<\/li>\n<li>Check whether the list contains such an item. This step is needed to avoid duplicates.<\/li>\n<li>If there is no item with such a title, then a new item is added.<\/li>\n<li>Repeat actions 2 to 4 for the second and third items of the feed.<\/li>\n<\/ol>\n\n<a name=\"background\"><\/a>\n<h2>Before Starting to Create a Workflow<\/h2>\n\n<b>1.<\/b> <i>Create a list and put it on one of the pages of the website.<\/i>\n\n<p>Enter the name of the new list (for example, \u201cNews\u201d), select \u201cAnnouncements\u201d type. Save the new list, and save the webpage.<\/p>\n\n<p><img decoding=\"async\" src=\"\/Pictures\/Scheduler\/Workflow-Scheduler-RSS-New-list-new.png\"\/><\/p>\n\n<p><b>2.<\/b> <i>Edit the list view.<\/i><\/p>\n\n<p>To edit the list view, open the web part editor (\u201cEdit Web Part\u201d).<\/p>\n\n<p><img decoding=\"async\" src=\"\/Pictures\/Scheduler\/Workflow-Scheduler-RSS-Change-View-new.png\"\/><\/p>\n\n<p>In the expanded options window, you can select and set up the list view. Select \u201cSummary view\u201d.<\/p>\n\n<p><img decoding=\"async\" src=\"\/Pictures\/Scheduler\/Workflow-Scheduler-RSS-Change-View-2-new.png\"\/><\/p>\n\n<a name=\"creation\"><\/a>\n<h2>Starting to Create a Workflow<\/h2>\n\n<p><b>1.<\/b> <i>Create a new workflow of \u201cSite Workflow\u201d type in SharePoint Designer.<\/i><\/p>\n<p><b>2.<\/b> <i>Create an initiation form parameter.<\/i><\/p>\n<p>To do that, click \u201cInitiation Form Parameters\u201d, \u201cAdd\u201d. Name the variable. As the RSS URL is a string, select this data type for the variable (\u201cSingle line of text\u201d). Click \u201cNext\u201d, enter the default URL of the RSS feed (for example, <a href=\"https:\/\/www.harepoint.com\/bitrix\/rss.php\">https:\/\/www.harepoint.com\/bitrix\/rss.php<\/a>), click \u201cFinish\u201d.<\/p>\n\n<p><img decoding=\"async\" src=\"\/Pictures\/Scheduler\/Workflow-Scheduler-RSS-Set-Parametrs-new.png\"\/><\/p>\n\n<p><b>3.<\/b> <i>Retrieve items of the RSS feed.<\/i>\nAdd the <b>\u201cFetch RSS Item\u201d action<\/b> in the workflow. Specify the parameter created in the first step as \u201cthis url\u201d parameter. Specify item number \u201c1\u201d in the action\u2019s options.<\/p>\n<p><img decoding=\"async\" src=\"\/Pictures\/Scheduler\/Workflow-Scheduler-RSS-Fetch-RSS-Item-new.png\"\/><\/p>\n<p><b>4.<\/b> <i>Check if there is an item with an identical title.<\/i><\/p>\n<p>Add the <b>\u201cIf any value equals value\u201d condition<\/b>. Edit the first value. In the \u201cField Data to Retrieve\u201d block select the list and the \u201cTitle\u201d field. In the \u201cFind the List Item\u201d block select the \u201cTitle\u201d field and the variable in which the <b>\u201cFetch RSS Item\u201d<\/b> action saved the title in the first step.<\/p>\n<p>Change \u201cequals\u201d condition to \u201cis empty\u201d condition. This condition will work if the list does not contain any item with a title identical to the title of the retrieved RSS feed item.<\/p>\n\n<p><img decoding=\"async\" src=\"\/Pictures\/Scheduler\/Workflow-Scheduler-RSS-If-Any-Value-new.png\"\/><\/p>\n\n<p><b>5.<\/b> <i>Create an item.<\/i><\/p>\n<p>If there is no item with a similar title, create such the item. To do that, add the <b>\u201cCreate List Item\u201d action<\/b> within the condition. Open editing of \u201cthis list\u201d parameter.<\/p>\n<p>Select the list you are working with. Select the variable which was used by the <b>\u201cFetch RSS Item\u201d action<\/b> to save the title in the first step, for the \u201cTitle\u201d field. Add a \u201cBody\u201d field. You can use the value of the variable with this description in the feed item as the value of this field. You can also use formatted text and several variables as the value. To do that, open the \u201cString Builder\u201d. The \u201cAdd or Change Lookup\u201d button adds variables to the text. Save all the parameters (\u201cOK\u201d buttons).<\/p>\n\n<p><img decoding=\"async\" src=\"\/Pictures\/Scheduler\/Workflow-Scheduler-RSS-Create-Item-new.png\"\/><\/p>\n\n<p>In order to retrieve the second and third feed items (or more items if needed) add the next workflow step, in which you need to repeat actions one to four. Do not forget to change the number of the received RSS feed item.<\/p>\n<p>The ready workflow looks as follows:<\/p>\n\n<p><a href=\"\/Pictures\/Scheduler\/Workflow-Scheduler-RSS-Overview.png\" data-rel=\"lightbox-image-0\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" src=\"\/Pictures\/Scheduler\/Workflow-Scheduler-RSS-Overview.png\"\/><\/a><\/p>\n\n<p>Save and publish the workflow. After that, it will become available on the website on the \u201cSite Workflows\u201d page. You can jump to this page by clicking a link in the \u201cAll Site Content\u201d section.<\/p>\n<p>When starting a workflow you can specify an RSS feed\u2019s URL which differs from the default one. To do that, just change the text in the parameter field to the needed URL.<\/p>\n\n<p><img decoding=\"async\" src=\"\/Pictures\/Scheduler\/Workflow-Scheduler-RSS-Start-new.png\"\/><\/p>\n\n<p>After completing the workflow, the three latest news items from the RSS feed will emerge in the list:<\/p>\n\n<p><img decoding=\"async\" src=\"\/Pictures\/Scheduler\/Workflow-Scheduler-RSS-Result-new.png\"\/><\/p>\n\n<a name=\"scheduling\"><\/a>\n<h2>Automated Scheduled Workflow Start<\/h2>\n<p>If you want the workflow to add the latest news to the list regularly, you may use the free <a href=\"\/Products\/HarePointWorkflowScheduler\/Default.aspx\">HarePoint Workflow Scheduler<\/a> which allows scheduling of SharePoint workflows.<\/p>\n<p>Create a new task for HarePoint Workflow Scheduler.<\/p>\n\n<p><img decoding=\"async\" src=\"\/Pictures\/Scheduler\/Workflow-Scheduler-RSS-New-Schedule.png\"\/><\/p>\n\n<p>Specify the task name, workflow, autorun schedule and workflow parameters (in our case it will be the URL of the RSS feed):<\/p>\n<p><img decoding=\"async\" src=\"\/Pictures\/Scheduler\/Workflow-Scheduler-RSS-Set-Workflow-Parametrs-new.png\"\/><\/p>\n<p>You will also need to select the account under which the workflow will start. Save the task.<\/p>\n<a name=\"conclusion\"><\/a>\n<h2>Conclusion<\/h2>\n<p>Using <a href=\"\/Products\/HarePointWorkflowExtensions\/Default.aspx\">HarePoint Workflow Extensions<\/a>, we could arrange news import within a few minutes without programming. By using conditions and actions of HarePoint Workflow Extensions you can create simple but effective workflows which would otherwise be impossible when using standard SharePoint components; and HarePoint Workflow Scheduler allows automated workflow start.<\/p>\n\n<p><b>You can also watch the whole process of creating such a workflow in this video:<\/p>\n<iframe loading=\"lazy\" width=\"560\" height=\"315\" src=\"https:\/\/www.youtube.com\/embed\/O-bN0fj0M-k\" frameborder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>\n","protected":false},"excerpt":{"rendered":"<p>This example will show you how to get news from RSS feeds, publish them on the SharePoint website and how to run automatically workflows according to the schedule. We will create a workflow that retrieves news from RSS feeds and publishes them in one of the lists on the website. <\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[13,25],"_links":{"self":[{"href":"https:\/\/www.harepoint.com\/Blog\/wp-json\/wp\/v2\/posts\/230"}],"collection":[{"href":"https:\/\/www.harepoint.com\/Blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.harepoint.com\/Blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.harepoint.com\/Blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.harepoint.com\/Blog\/wp-json\/wp\/v2\/comments?post=230"}],"version-history":[{"count":6,"href":"https:\/\/www.harepoint.com\/Blog\/wp-json\/wp\/v2\/posts\/230\/revisions"}],"predecessor-version":[{"id":966,"href":"https:\/\/www.harepoint.com\/Blog\/wp-json\/wp\/v2\/posts\/230\/revisions\/966"}],"wp:attachment":[{"href":"https:\/\/www.harepoint.com\/Blog\/wp-json\/wp\/v2\/media?parent=230"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.harepoint.com\/Blog\/wp-json\/wp\/v2\/categories?post=230"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.harepoint.com\/Blog\/wp-json\/wp\/v2\/tags?post=230"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}