Intermediate | Flow of the Week: How to Archive Completed Items in a SharePoint List

Hey Flow Fans!

This week’s Flow of the Week is focused on demonstrating three Flow skill sets:

  1. Moving SharePoint items from one SharePoint list to another SharePoint list.
  2. Using Boolean conditions with respect to certain SharePoint item elements to determine the next Flow action.
  3. Using Approvals as user checkpoints.

Individually, those steps are great beginner skill sets, but in this intermediate Flow, I want to demonstrate how to combine these three features to solve a business problem.

 

The business scenario:

As a content manager, I receive a month’s worth of written blog posts at the beginning of every month via SharePoint List that I plug into our team’s scheduling tool to publish according a specific cadence.

Every item in that SharePoint list of articles to publish includes the following data:

  • Title/Author Name (String)
  • Author Email (String)
  • Publish Deadline (Date & Time: MM/dd/yyyy @ hh:mm tt)
  • Publish Complete? (Boolean Check Box: Yes / No -> default value: No)

Below is a screenshot of the SharePoint list that information is plugged into:

 

For example, I take a week’s worth of written submissions from my team of five authors and schedule them to be published on our blog every Wed at 10:00 AM. At the end of that work process, I consider each scheduling task completed once I confirm their content has been pushed LIVE.

 

The business problem:

While the measurement of success is mainly identified by the content status of being “published” or “not published”, I run into the problem of the manual & repetitive steps required of me to “clean house” and keep my scheduling SharePoint list relevant with only content for that month that still needs to be scheduled for that month. If a submission has already been published, it’s no longer relevant to keep that item in my scheduling SharePoint list. To clear that item out once the item is published, I must manually duplicate that item in a separate SharePoint list I label as “Archive” that stores all the published articles for reference.

There’s got to be a way to automate that…wait, THERE IS!

Cue Flow thinking hat: below is a high-level work flow of what I manual steps I want done auto-magically. For me personally, I find it helpful to map out these high-level actions so I can then translate it into Flow-specific actions.

 

Scenario cue: If an article is published, go into the “Blog Scheduling SharePoint” to update the “Publish Complete” checkbox status – i.e. modify an item in SharePoint list.

Set up your Flow: Follow along with these steps to set up your Flow that automates moving a SharePoint item from one list (“Scheduling”) to another SharePoint list (“Archive”) and includes Boolean conditions to determine certain actions.

1. Set SharePoint trigger “When an item is created or modified”:

2. Set the Boolean condition: If an article is published and its respective SharePoint list item is modified by marking the “Publish Complete?” checkbox as “YES”, do the following set of actions:

3. If YESCompose SharePoint item “Publish Deadline” date into email friendly format (to be used in email later):

         Expression: formatdatetime(triggerBody()?['Publish_Deadline'],'MM/dd/yyyy')

         Compose SharePoint item “Date Published” date into email friendly format (to be used in email later):

  

         Expression: formatDateTime(triggerBody()?['Date_Published'],'MM/dd/yyyy')

 

4. Start Approval to myself to archive this item (optional: custom messaging in details):

5. Set Boolean condition: If archive action is approved, do the following actions:

6. If archive action is APPROVED:

Capture the date the “Blog Scheduling SharePoint” item was modified. From a user perspective, you can assume that the date it was modified is also the date the article was published. I used the Convert time zone action:

         Create item in second SharePoint list:

         Data that was relevant to keep in my Archive records are:

  • Title / Author Name (pulled from SP List #1)
  • Author Email (pulled from SP List #1)
  • Publish Deadline (pulled from SP List #1)
  • Published? Status (pulled from SP List #1)
  • Date Published (pulled from Convert time zone)

Once the item has been moved (or essentially duplicated with the relevant information), Delete the item in Blog Scheduling SharePoint List that is now no longer relevant and available in an Archive SharePoint list.

DONE!

With additional options to include more approval points and Boolean conditions, this is what my finished Flow looks like:

Overall, I hope this FOTW helped walk you through how to combine skill sets of moving SharePoint list items from one SharePoint List to another, using Boolean conditions, and starting Approvals to determine the following set of Flow actions.

If you have any questions, feel free to comment below!

Happy Flowing,

-AT (Flow Community Admin)