Finally–we’re to the good stuff!
In the first part of this series, we talked about setting the stage with the requirements, and then went on to create the basic staging and production sites, update the retention policies to exclude the staging site, and configure the taxonomy.
In part two, we dug into some basic site customizations for the video portal.
Preparing us for ….
…. Configuring some workflows!
In this section, we’re going to configure two workflows–one that notifies an administrator that a new file has been posted to the staging site, and one that moves an approved file from the staging site to the production site.
Configuring the initial notification flow
This flow is pretty simple to create, so let’s get started on it.
- Navigate to one of the Staging libraries. For this example, I’m going to use the Cooking library.
- Select the ellipses (if the automate is not available on the main menu), point to Automate, point to Power Automate, and then select Create a flow.
- Select the Send a customized email when a new file is added template from the list.
- If necessary, sign in (or switch accounts) for any of the services.
- If this is the first time you’ve authorized Power Automate to interact with an account, you may need to grant consent.
- Click Create flow.
- Click Edit to modify the flow.
- Edit the name of the flow before you go too far–that way, it will be easily identifiable later if you need to troubleshoot or modify it.
- Unless you’re going to use content from the Get my profile (v2) action, just delete it. Most of the fields we’re going to specify values manually. When you delete it, it will inform you that dynamic content tokens that are used in the Send an email action will be removed.
- Expand the Send an email action by clicking on its title bar.
- Fill out the To field with the recipient. You can use one or more users or a mail-enabled group. You can also click the Show advanced options to expose more fields for the email message. There isn’t an automatic mail-enabled recipient for the owners of a modern SharePoint site, so you may want to create one (depending on who will be responsible for handling the approvals).
- This is a good time to click Save.
- One of the
This flow will now notify whoever is listed in the “To” or “Cc” fields that a new file has been posted. The message body supports HTML, so you can add hyperlinks (as I did) to resources such as how to manage approvals, the link for the containing SharePoint site library, or even your favorite cat videos. The sky’s really the limit, folks.
You can repeat this process for every library in the staging site.
Configuring what happens after approval
Based on our original staging site configuration, newly uploaded files will be placed in a Pending state, visible only to site or library administrators and the individual who uploaded the file. Once the file has been approved, the business goal is to move the file to the production site where it can be categorized and found by other users.
To configure this flow, follow these steps:
- Navigate to Power Automate. For Commercial customers, it’s https://flow.microsoft.com. For GCC customers, head over to https://gov.flow.microsoft.us.
- Click +Create, and then select Automated cloud flow.
- Click Skip to create a blank flow.
- Select SharePoint from the connector list to filter the triggers by that service.
- Search for the When a file is created or modified (properties only) trigger.
- In the Site address field of the SharePoint trigger, select the Staging site.
- In the Library field, select the library you’re working with. Leave the Folder value blank (unless you’ve placed additional structure in there).
- Click + New step.
- Search for the Condition control and add it.
- Click inside the left-hand side of the condition control, and select the Content approval status dynamic content token under the When a file is created or modified (properties only) section. Set the evaluation method to is equal to, and then enter the text value Approved.
- In the If yes (green) branch of the condition, select Add an action.
- Add the SharePoint – Move file action.
- Fill it out with the following properties:
– Select the Staging site for the Current Site Address field
– In the File to move field, select the Full path dynamic content token under the When a file is created or modified (properties only) section
– Select the Production site for the Destination Site Address field
– Select the value representing the destination library for the Destination Folder field
– Select Replace or Move with a new name for the If another file is already there, depending on how you want to deal with conflict resolution
- Select Add an action under the Move file action.
- Add the SharePoint – Update file properties action.
- Fill it out with the following properties:
– For the Site Address field, select the Production site.
– For the Library Name field, select the appropriate library where the new file resides.
– For the Id field, select the ItemId dynamic content token under the Move file section.
– Select the Title dynamic content token under the When a file is created or modified (properties only) section for the Title field
– For the Description field, select the Description dynamic content token under the When a file is created or modified (properties only) section
– For the Enterprise Tags field, select the Enterprise Tags dynamic content token under the When a file is created or modified (properties only) section
- Under the If no (red) branch of the condition, select Add an action.
- Select the Outlook – Send an email (v2) action.
- Fill out the email action, using the Created by email dynamic content token in the To field. This will notify the original uploader that their item was rejected. Fill out any additional data as desired.
- Click Save.
Repeat this process for any additional staging libraries.
Testing it Out
Once you’ve completed the flows, it’s time to test. Simply log in as a user to SharePoint Online, navigate to the staging site, and upload a new video to one of the libraries for which you’ve configured the approvals and automation. Then, while logged in as a site owner or administrator, you should see the initial email directing you to the site, and you should be able to approve the item.
Here’s an example of how it looks:
Uploading a document as a user
In this example, I’m going to upload a video while logged in as one of my demo users, Debra.
- Navigate to the Staging site, and then select the Cooking library (or one of the libraries you created).
- Upload a file, and fill out any properties desired. Notice the Approval Status column is set to Pending.
That’s it. It’s a pretty basic, no-frills process.
Approving the file as a site owner
For the next steps, we’re going to follow the process as an administrator or owner of the site.
- Log into Outlook to view the notification.
- Click on the link to the library in the email.
- Click on the ellipsis next to the file, point to More, and then select Approve/Reject. You can also get to Approve/Reject by selecting the ellipsis on the menu bar and selecting it from there.
- Select the Approve radio button and click OK.
- At this point, you can either go back to the Staging site and wait for the file to disappear, or you can go to the Production site and wait for the file to appear in the corresponding library.
- Another good check to do might be to head to the landing page of the Production site and look to see that the video pops up in the Highlighted content web part.
Congratulate yourself with a tasty beverage of your choosing.
Once you’ve completed the tasks and seen it in action, feel free to further expand on it. I’d love to hear some feedback on the cool things you’re doing.