Category: Power Automate

  • Use Power Automate to create terms in the term store

    Use Power Automate to create terms in the term store

    Introduction

     With the introduction of SharePoint V2 REST API for Managed Metadata services, it has become very easy to create a term in term store using REST API. But what if we would like to automate things? In such cases we can use the help of Power Automate. In the automation, we would create a simple custom SharePoint list with only title field, and when a user enters the item in the list we would create a term for that particular title. 

    Steps to be used to create flow using Power Automate

    Step 1 – Select the trigger (when an item is created) We require this flow to trigger when a new item is created in the list, so we select the trigger as “when an item is created”. Once we have selected the trigger we need to select the site collection where the list is present and the list for which we need this trigger to work, 

    How To Create Term In Term Store Using Power Automate

    Step 2 – Create variables (Initialize variable) We will create two variables with the step named “Initialize variable” Let us set the name of the variables as mentioned below:

    1. GroupId
    2. TermSetId

    We will use string as the type of both the variables. We can provide the value as Group Id and TermSet Id. To fetch the Id of group and term set we can navigate to the SharePoint admin center and expand the content service section present in the left navigation and click on Term store. Click on the group under which we need to create the term and copy the “Unique identifier” field value. In the same process for the term set, we can select the term set under which we need to create the term and copy the “Unique identifier” field value. 

    How To Create Term In Term Store Using Power Automate
    How To Create Term In Term Store Using Power Automate

    Step 3 – REST API (Send an HTTP request to SharePoint) We will now send the REST API to create the term, for that we will add a step named “Send an HTTP request to SharePoint”. This will allow us to use the SharePoint REST API v2 for Managed Metadata service for creating terms. Site Address – We can select the site address from where we need to post the API.Method – We will Select POST as the method value. Uri

    1. _api/v2.1/termStore/groups/@{variables(‘GroupId’)}/sets/@{variables(‘TermSetId’)}/children   

    NoteWe will use the groupId and TermSetId variables in the URI. Body

    1. {  
    2.     “labels”: [  
    3.         {  
    4.             “name”: “@{triggerBody()?[‘Title’]}”,  
    5.             “isDefault”: true,  
    6.             “languageTag”: “en-US”  
    7.         }  
    8.     ],  
    9.     “descriptions”: [  
    10.         {  
    11.             “description”: “@{triggerBody()?[‘Title’]}”,  
    12.             “languageTag”: “en-US”  
    13.         }  
    14.     ]  
    15. }   

    NoteWe have used the title as name and description of the term but we can use another field value created in the list as described. 

    How To Create Term In Term Store Using Power Automate

    Conclusion

     Term creation is automated by using flow in Power Automate. This can be helpful as most of the users will not have access to term store but they can create an entry in the list and if the user who has created the flow has proper access to create the term, then the terms get created in Term Store.

  • Build a policies and procedures hub with Microsoft 365 – Part 02

    Build a policies and procedures hub with Microsoft 365 – Part 02

    Introduction

    In the previous post, we created and configured a SharePoint team site for storing policy and procedure documents and a list that will be used to track who has and who has not read a document.

    In this post, we’ll create a PowerApp that will list documets that are assigned to each user.

    Before we start:

    • upload at least one document to the library that houses your policies and procedures
    • create a task in the task list and assign it to yourself

    Creating the app

    Follow these steps to create a simple app that will list a user’s outstanding documents and allow them to complete an acknowledge task.

    1. Go to https://powerapps.microsoft.com and create a new canvas app from blank
  • Build a policies and procedures hub with Microsoft 365 – Part 01

    Build a policies and procedures hub with Microsoft 365 – Part 01

    Introduction

    Policies and procedures play an essential role in any organisation and it is essential that employees have access to the latest documentation.

    By combining SharePoint and the Power Platform, it is quite easy to create a robust solution that can mange the creation and dissemination of these documents, as well as tracking who has

    In this series of posts, we will:

    • create a policies and procedures team site SharePoint
    • create site columns using the tenant-wide term store
    • use Power Automate to send notifications to readers and creators
    • create a PowerApp to allow users to acknowledge that they have read and understood the document
    • create a policies and procedures hub (using the PnP modern search web parts)
    • create a Power BI dashboard to show reports

    Pre-requisites

    The following instructions are written with the assumption that you have exposure to SharePoint and the Power Platform, as well as sufficient privileges, e.g., Tenant global admin, Term store admin, etc..

    Create terms

    We’re using the term store to provide values for the metadata in the site columns used in the policies and procedures document library.

    You can always skip this step and create other types of columns, e.g., choice or lookup.

    The beauty of using the term store is that the metadata can be used in sites across your whole tenant, i.e., you don’t need to replicate terms for each site collection.

    To create new terms in the term store:

    • Go to Microsoft 365 admin center
    • Select see all > SharePoint
    • Select Content services > Term store
      (https://YOURTENANT-admin.sharepoint.com/_layouts/15/online/AdminHome.aspx#/termStoreAdminCenter)
    • Select Add term group
    Modern term store experience
    • Give the term group a name (we’re using Policies and Procedures)
    • Within this group, create the following term sets and values:
      • Business unit
        • Accounts
        • Business support
        • Finance
        • HR
        • IT
        • Operations
      • Document type
        • Guideline
        • Manual
        • Policy
        • Procedure

    For information about the term store, click here.

    To learn how you populate the term store using Power Automate, click here.

    The SharePoint team site

    Now, we’ll create a SharePoint team site to store the policy and procedure documents. This site will also contain the lists that will be used to track the status of documents, e.g., who has and who hasn’t read a document.

    The team site we are using is called Polices & Procedures Team (https://TENANT.Sharepoint.com/sites/PoliciesProceduresTeam).

    Site columns

    We now need to create the site columns (they need to be site columns to make use of the search functionality later on).

    Use a good naming convention for the internal name for your columns, e.g., create a column called BusinessUnit and rename it Business unit afterwards. This prevents special characters appearing the name of the column.

    The site columns we need to create are:

    NameType
    Business UnitManaged metadata
    (use Business unit term set we just created)
    Document typeManaged metadata
    (use the Document type term set we just created)
    Document ownerPerson or group
    Published dateDate and time
    (Date only)
    Next review dateDate
    (Date only)
    Date assignedDate
    (Date only)
    Assigned toPerson or group
    Acknowledgement statusSingle line of text
    (Default value is Assigned)

    Content types

    Next we need to create the content types and add the necessary site columns.

    NameParentColumns
    Policy and procedure documentDocumentBusiness unit
    Document type
    Document owner
    Published date
    Next review date
    Policy and procedure taskItemAssigned to
    Date assigned
    Acknowledgement status

    Library and list

    Next, we need to create a document library (rather than using Shared documents) and a task list. We’re calling our library ‘Policy and Procedure documents’ and our list ‘Acknowledgements’.

    To make things easier and repeatable, e.g., to move between environments, we have created a site design that you can download from here.

    Next steps

    In this post, we have configured the SharePoint team site that will be used to store our policies and procedures, as well as a list that will track who has and who has not read each document.

    In Part 02, we’ll use PowerApps to create a simple canvas app that displays a list of documents for a user to acknowledge.

  • Easily convert Word documents to PDF with Power Automate

    Easily convert Word documents to PDF with Power Automate

    Converting a Microsoft Word document in SharePoint to PDF is a great way to prevent further editing, but traditionally it was difficult to automate without code or a third-party plugin.

    Now, though, Microsoft Flow makes it quite straight forward.

    In the below tutorial, I’m going to show you how to create a flow to convert documents to PDF using just six steps (with the help of OneDrive for Business).

    Screenshot of Microsoft Flow for converting Word document into PDF

    I’m going to assume you know how to create flows and are familiar with actions, connections and dynamic content.

    Creating the flow

    1. In this example, we’ll create a flow from blank and use the ‘for a selected file’ trigger.

    Screenshot of Microsoft Flow - Creating a flow from blank and use the ‘for a selected file’ trigger.

    2. Then, we’ll enter the details of the site collection and document library that we want to run workflow on.

    Screenshot of Microsoft Flow - Details of the site collection and document library to run workflow on.

    3. Then, we’ll add a new step for the ‘get file properties’ action. This is where we identify the file to convert. Use the same site address and library name as the previous step and choose ‘FileId’ from the options in dynamic content.

    Screenshot of Microsoft Flow - 'Get file properties' action.

    4. Now that we know which document to convert, we need to get the content of the document. To do this, add the ‘Get file content’ action. Use the same site address as before and choose ‘Identifier’ from the dynamic content.

    Screenshot of Microsoft Flow - 'Get file content' action.

    5. Now we need to create the document in OneDrive for Business (you may need to set up the connection if it hasn’t already been set up). For the folder path, navigate to the folder that will store the documents you want to convert. I’m using ‘Files for conversion’.

    For the file name, use ‘File name with extension’ from the dynamic content. For the file content, select ‘File Content’ from the dynamic content.

    Screenshot of Microsoft Flow - 'Create file' action.

    6. Next, use the OneDrive for Business ‘Convert file’ action. Use ‘Id’ from dynamic content to populate the file field. Type ‘PDF’ into the target type.

    NB: The ‘convert file’ action doesn’t create a PDF in your One Drive for Business file.

    Screenshot of Microsoft Flow - 'Convert file (Preview)' action.

    7. Now the convert action file has been added, add a ‘Create file’ action. I’ve used the same site collection and document library as earlier but you can create the convert file in other site collections or libraries.

    For the file name, use ‘Display name’ from the dynamic content. For the file content, select ‘File Content’ from the dynamic content.

    Screenshot of Microsoft Flow - 'Create file' action.

    Converting a document

    1. Back in SharePoint, go to  the document library that was used to create the flow.
    2. Select the document that you want to convert and then select ‘Flow’. From here choose ‘Convert Word to PDF’.

    Screenshot of SharePoint - Flow tab and relevant drop down options

    3. Select ‘Run flow’.

    4. The flow will run.

    5. Your Word document has now been converted to PDF.

    Next steps

    Now that you know how to convert Word documents to PDF, you can expand this flow to complete further actions, such as email the PDF as an attachment, send notifications, delete the newly created file from OneDrive, or archive the original Word document.

  • @ mentioning people in Microsoft Teams with Power Automate

    @ mentioning people in Microsoft Teams with Power Automate

    Introduction

    Users have long been able to use the ‘send a message in Teams’ action but, unless people checked every channel of every team they wouldn’t know about the post.

    Now though, the Team bot can post a message AND notify the tagged user, so they know there is a message to read.

    In this post, I’m going to show you how to assign a task to a user and then notify the assignee, through the ‘Post a message as the Flow bot to a channel’ action (currently in preview).

    Prerequisites

    I’m going to assume that you have a basic working knowledge of Flow, SharePoint and Teams.

    Before we start, you’ll need a SharePoint list (using the modern experience), with the following columns:

    • Title
    • Description
    • Assigned to
    • Due date
    • Status

    And, of course, you’ll need an account for Microsoft Flow and a Microsoft Team to post to.

    Building the Flow

    1. Log into SharePoint and access your list and select Flow > Create a flow.

    2. From the dialog, select ‘Post message to Microsoft Teams for a selected item’.

    3. Select more and then select ‘Complete a custom action for the selected item’.

    4. Flow will open in a new tab (you may need to connect Flow to SharePoint and there is more information here).

    5. Select ‘Continue’.

    6. Give the flow a name and select save.

    7. Delete the text input

    8. Next, add a new action by selecting the new step button.

    9. Enter ‘Teams’ in the search box and select the Microsoft Teams icon.

    10. Select the Post a message as the Flow bot to a channel (preview) 

    11. Select the Team and Channel that you want to post to and then it’s time to create your message.

    Creating the message

    To get @mention to work, you only need to use a simple line of code, but I’m going to add a little bit of detail so that the mentioned user has something to read.

    1. In the message field, type <at></at> and place your cursor between the > and the <.

    2. In the dynamic content search box, select ‘Assigned to Email’.

    3. The assignee’s email address will be placed between the opening and closing tags

    4. Now the flow is configured to notify a user that they have a new message to read but, as I said, I’ll add more task information for context.

    Note: I’ve also used some basic HTML to format the message to make it more readable. You can read more about HTML here

    5. Now, you can return to your list and test your flow.

    6. If you haven’t already done so, create a task and assign to yourself.

    7. Select the task > Flow > your flow (in my case it’s ‘Post to Teams with @’).

    8. Select ‘Run flow’.

    9. You’ll receive a desktop notification.

    10. Open the Teams channel and view your message.

    Conclusion

    In this article, we have looked at how to use the Post to Microsoft Teams as the team bot action to post a message in Teams and alert a user. We did this by creating a manually triggered flow on a list, notifying the assignee of the task.