Follow

Microsoft Flow and PowerApps

Article last updated on the 8th of November 2019.

1. Introduction

Microsoft PowerApps is a formula tool for can be used for creating formulas and small applications. PowerApps has a series of connectors which can be used to interface to a wide range of systems.

Microsoft Flow is a workflow product which replaces the standard SharePoint workflows. Microsoft Flow workflows are independent of SharePoint and have, like PowerApps, a series of connectors for a wide range of other systems.

A typical use case for the integration and use of Microsoft PowerApps and Microsoft Flow is in relation to approval processes for documents, e.g. when sending a document for approval by another person. Before this integration, this scenario would require a registered flow on all document libraries where this process is needed. A problem with this method is that in WorkPoint, one can easily have several thousands of document libraries, and thus, it is not advisable or technically possible to replicate the same flow onto every document library.

Integration with PowerApps and Flow makes it possible to have one central flow which can be called from each document. In addition, a PowerApps formula can be used to start a flow, thereby opening for users to fill in different parameters. This would allow the user to set up individual approval processes for individual documents or for a group of documents or templates.

2. Requirements

Utilizing Microsoft Flow and PowerApp integration in WorkPoint requires a specific feature license. Please contact WorkPoint sales at sales@workpoint.dk for more information on purchasing a license for this feature.

This feature also requires that the solution is working in the Modern UI version of WorkPoint, as well as exclusively on WorkPoint 365. This feature is not accessible with WorkPoint On-Prem solutions.

3. Configuration

Before Microsoft Flow and/or PowerApp can be used in WorkPoint, a Flow or  a PowerApp must first be created via Office 365. Examples on how to create both Flows and PowerApps are described in the following sections.

It should be noted that both Flows and PowerApps utilize parameters which, through the integration with WorkPoint, can be sent alongside e.g. documents. While Flows handle parameters as separate items, Microsoft PowerApps handles parameters as URL parameters. This means that the URL of PowerApps may become so long that it exceeds the limit of how many characters a URL may be, which breaks the functionality of the PowerApp. Therefore, if sending a lot of parameters along with the document, it is preferable to use Microsoft Flow over Microsoft PowerApps.

   3.1. Creating a Flow

In this example, we will create a flow which sends an email containing a parameter from a document in the email body once the flow is triggered from within WorkPoint.

In order to set up a flow, follow these steps:

  1. On your WorkPoint solution, access the Office settings by clicking the dotted square icon in the top left of the solution.
  2. Click the “Flow” button from the Apps menu.
  1. From the Flow side menu, click the “My Flows”-button
  1. From the list of Flows, click the “New”-button and choose how to create a new flow. In the following example the “Instant – from blank” will be shown.
  1. In this example, the “Build an instant flow”-window is skipped as shown above. In case a custom name for the flow is preferred over the automatically generated one provided by Microsoft when this step is skipped, a name for the flow can be provided in the "Flow name"-field. In that case, "From Microsoft Flow" should be selected in the "Choose how to trigger this flow"-selection menu. Then click "Create".
  1. In the following window, use the search field to search for “http”.
  2. Select “when a HTTP request is received.
  1. After the “When a HTTP request is received” step is created, add an additional step by clicking the “New step”-button. This is the step that makes possible the integration with WorkPoint.
  1. In this example, the “Send me an email notification”-step is selected.
  1. A text for the Subject has been typed in.
  2. As an alternative to typing in the subject and body of the email to b e sent, dynamic content can be inserted by clicking the parameter from the right-most panel.

Once these steps have been set up, click the “Save”-button.

  1. In the list of available Flows, which can be accessed from the “My Flows”-button in the left-most panel, the created Flow can be found. The name is auto-generated by the system, as we did not specify one before Step 5 in the “Flow name”-field.
  2. Action relating to the Flow can be accessed through the “More commands”-menu.
  1. IMPORTANT: When editing the created Flow and selecting the “When a HTTP request is received”-step, a HTTP POST URL is displayed. This URL is a requirement when setting up a Microsoft Flow in WorkPoint. It is therefore important to know how to acquire this URL. It is also important to note that this URL is only generated after the entire Flow including all steps have been saved.

   3.2. Flow configuration in WorkPoint 365

In order to configure a Flow in WorkPoint 365, follow these steps:

  1. In the WorkPoint 365 Administration, click the header of the business module for which you wish to set up the Microsoft Flow and PowerApps integration.
  2. Click the “Microsoft Flow and PowerApps integration”-button from the drop-down menu.
  1. Click the “New Flow”-button to add a new flow to the configuration.
  2. Click the “New PowerApp” to add a new PowerApp to the configuration.
  1. Tick on or off the “enable” checker to enable or disable this flow.
  2. The flow can be given a title by filling in the “Title” field.
  3. One or more translations for the title can be provided by selecting a language from the drop-down menu, and filling in the text field. Add more translations by clicking the "+" button.
  4. The flow can also be given a flow description by filling in the “Description” field.
  5. One or more translations for the flow description can be provided by selecting a language from the drop-down menu, and filling in the text field. Add more translations by clicking the "+" button.
  6. Insert the Http Post URL for the flow you wish to run. This step presupposes that a flow has been set up, which generates a Http Post URL. Steps to locate the Http Post URL are outlined in section 3.1.
  7. The “List” field determines the list from where it should be possible to run this flow.
  8. In the “Parameters” field, add the fields you wish to include in the flow. These can be from both the entity or document. To add a parameter, click "Add Parameter". The following interface opens for adding a parameter:

For "Type", the following options are available:

  • Document Field (used for parameters which pulls data from a field on a document)
  • Entity Field(used for parameters which pulls data from a field on an entity)

The "Source Field" options depend on the Type selected. Source fields are fields in WorkPoint from which data can be pulled.

The Parameter Name can be set in the "Parameter Name" field.

Click the "Add Parameter" button once the parameter is configured to add it to the list of parameters.

  1. The “Permission” field determines which level of access to the document a user must have in order to be able to start the flow.

Once the configuration is finished, click the “Save”-button. Alternatively, cancel the configuration by clicking the “Cancel”-button.

Please note that the “Send to” button from which Flows and PowerApps are run will not appear before the WorkPoint 365 Browser Cache is cleared. This can be done by following these steps:

  1. On the WorkPoint solution, click the “Home”-button.
  2. In the bottom of the menu, click the “Need help?”-button.
  3. Click “Clear WorkPoint browser cache”.

 

   3.3. Testing the Flow integration

After having configured both a Microsoft Flow and the integration with WorkPoint in sections 3.1 and 3.2, a test can be performed to see if the integration was successful. To do this, follow these steps:

 

  1. Click the header of the business module for which the integration has been set up.
  2. Click the “Microsoft Flow and PowerApp integration”-button.

 

  1. Click the “Edit”-button for the Flow you have created. The following edit window should open:

 

Now, in a separate internet browser tab, perform the following steps:

 

  1. In the Microsoft Flow page (www.flow.microsoft.com), navigate to the “My flows”-page.
  2. Click the “Edit”-button for the flow that was configured earlier. The following edit page should appear:

 

  1. In the editing page shown in the image, click the header of the “When a HTTP request is received.
  2. Make sure that the URL in the HTTP Post url field matches the link that was put inside the Flow configuration in WorkPoint (7)

 

  1. After validating that the two URLs match, click the “Test”-button in the top right of the Flow editing page.
  1. Check “I’ll perform the trigger action”.
  2. Click the “Test”-button.

The Flow edit page will turn blank with a turning-wheel spinning, awaiting some trigger. Now back in the edit page for the WorkPoint Flow configuration, follow these steps:

 

  1. Click the “Test”-button from the WorkPoint Flow configuration page.
  1. If there is no text inside the JSON Sample box, try clicking the “Reset”-button (13).
  1. Click the “Test”-button to perform the test.

The test should now run, and on a successful test, the following page should appear in the Microsoft Flow edit page:

Note the yellow bar in the top with the text saying “Your flow ran successfully”. If the configuration of the Microsoft Flow was performed as shown in section 3.1, you should also receive an email containing the body of the JSON Sample.

   3.4. Creating a PowerApp

In order to create a Microsoft PowerApp, follow these steps:

  1. On your WorkPoint solution, access the Office settings by clicking the dotted square icon in the top left of the solution. If present, click the “PowerApps”-button.
  2. If the “PowerApps”-button is not present in the list of apps, click the “All apps”-button and search for “PowerApps”. Click the “PowerApps”-button.
  1. From the Microsoft PowerApps page, click the “Create”-button in the left-most panel.
  2. Select the “Canvas app from blank”-button
  1. Give the app some name. This name should be easily identifiable for later use.
  2. Select the Phone format. This makes the integration into WorkPoint 365 more user-friendly, as the PowerApp is displayed in a portrait format. A Tablet layout will make the PowerApp display is a landscape format.
  1. From the PowerApps welcome message window, select “Create a form”.
  1. Select each pre-existing element in the form and delete them. Then add a Text input to the form
  1. The Text input field is created in the form.
  2. In the advanced tab, different parameters and elements of the Text input field can be assigned.
  3. In the “Data”-section, the “Default”-field default value has been substituted with “Param(“Document_DocName”). This means that we eventually want to insert data from a parameter titled “Document_DocName” from the WorkPoint solution from which we want to run this PowerApp.

Note that if the parameter from WorkPoint that this field should be paired with is from a document, the parameter should be prefixed with “Document_”. Therefore, if in WorkPoint the parameter is called “DocName”, the name you have to provide in the Param-field here in PowerApps should be “Document_DocName”.

If the parameters from WorkPoint that a field should be paired with is from e.g. a Company entity in WorkPoint, the parameter should be prefixed with "Entity_". An example could be pulling data such as a company name. In this case, the field could be called "CompanyName" in WorkPoint, thus the parameter used for the PowerApp should be "Entity_CompanyName".

  • If pulling data from a document, prefix the parameter with "Document_". Examples: Document_DocName, Document_Created, Document_CheckoutUser.
  • If pulling data from an entity, prefix the parameter with "Entity_". Examples: Entity_Title, Entity_wpCompanyId, Entity_wpVAT.
  1. Navigate to the “File”-menu.
  2. Click the “Save as”-button from the menu.
  3. Give the PowerApp a title.
  4. Click the “Save”-button.
  1. Now access the Office 365 settings by clicking the dotted square icon.
  2. Click the “All apps”-button.
  1. Click the “PowerApps”-button.
  1. Note that the newly created PowerApp exists in the list of apps. In order to view the detail of this app, first select it.
  2. Click the “More commands”-button.
  3. Click the “Details”-button from the menu.
  1. IMPORTANT: In the Details page, the App ID is shown. This App ID is a requirement when setting up a Microsoft PowerApp in WorkPoint. It is therefore important to know how to acquire this App ID.

 

   3.5. PowerApp configuration in WorkPoint 365

In order to configure a PowerApp in WorkPoint 365, follow these steps:

  1. In the WorkPoint 365 Administration, click the header of the business module for which you wish to set up the Microsoft Flow and PowerApps integration.
  2. Click the “Microsoft Flow and PowerApps integration”-button from the drop-down menu.
  1. Click the “New Flow”-button to add a new flow to the configuration.
  2. Click the “New PowerApp” to add a new PowerApp to the configuration.

 

  1. Tick on or off the “enable” checker to enable or disable this PowerApp.
  2. A title for the PowerApp can be provided in the text field
  3. One or more translations for the PowerApp title can be provided by selecting a language from the drop-down menu, and filling in the text field. Add more translations by clicking the "+" button.
  4. The PowerApp can also be given a description by filling in the “Description” field.
  5. One or more translations for the PowerApp description can be provided by selecting a language from the drop-down menu, and filling in the text field. Add more translations by clicking the "+" button.
  6. Insert the App ID of the PowerApp that you wish to run. The details on how to acquire the App ID are detailed in section 3.3.
  7. The “List” field determines the list from where it should be possible to run this PowerApp
  8. In the “Parameters” field, add the fields you wish to include in the PowerApp. These can be from both the entity or document. To add a parameter, click "Add Parameter". The following interface opens for adding a parameter:

For "Type", the following options are available:

  • Document Field (used for parameters which pulls data from a field on a document)
  • Entity Field (used for parameters which pulls data from a field on an entity)

The "Source Field" options depend on the Type selected. Source fields are fields in WorkPoint from which data can be pulled.

The Parameter Name can be set in the "Parameter Name" field.

Click the "Add Parameter" button once the parameter is configured to add it to the list of parameters.

  1. The “Permission” field determines which level of access to the document a user must have in order to be able to start the PowerApp.

Once the configuration is finished, click the "Save" button.

Please note that the “Send to” button from which Flows and PowerApps are run will not appear before the WorkPoint 365 Browser Cache is cleared. This can be done by following these steps:

  1. On the WorkPoint solution, click the “Home”-button.
  2. In the bottom of the menu, click the “Need help?”-button.
  3. Click “Clear WorkPoint browser cache”.

   3.6. Testing the PowerApps integration

After having configured both a Microsoft PowerApp and the integration with WorkPoint, you can perform a test to see if the integration was successful. To do this, follow these steps:

  1. In a documents library on the business module for which Microsoft PowerApps integration has been performed, select a document.
  2. Click the “Send to”-button from the commands-panel.
  1. Select the PowerApp that was configured.
  1. WorkPoint displays a side panel which displays the PowerApp in the configuration which was created from within the Microsoft PowerApps interface.

In case the correct document title is not displayed in the Text input-field, make sure that:

a.  The title is correctly set. The parameter is displaying the document title, not the document name.

b.  Make sure, in the PowerApps interface, that the parameter set to be displayed is set to “Document_DocTitle”, as described in section 3.4, step 11.

4. End User Guide

Once a Flow or PowerApp has been set up, they can be used in combination with e.g. documents in a documents library:

  1. In a documents library, the user selects a document.
  2. The “Send to”-button enables the user to use a Flow or PowerApp with the document.

The “Send to”-button opens the dialogue above, which lets the user choose either a Flow or a PowerApp to use with the selected document. The list shows all available configured Flows and PowerApps.

5. Notes

An important difference between Microsoft Flow and Microsoft PowerApps is the way they handle parameters. Flows handle parameters as separate items, Microsoft PowerApps handles parameters as URL parameters. This means that the URL of PowerApps may become so long that it exceeds the limit of how many characters a URL may be, which breaks the functionality of the PowerApp. Therefore, if sending a lot of parameters along with the document, it is preferable to use Microsoft Flow over Microsoft PowerApps.

Please note that a parameter called “Document_ListRelativeUrl” is always sent to the Flow or PowerApp being run. This is a relative URL to the location of the file being copied. An example of this URL could be “/sites/myworkpoint/Company3/Documents”.

Have more questions? Submit a request