Sunday, October 22, 2017

Conditional approval in Microsoft Flow

I’m working on self-service solution in Office 365 where a requirement is that your manager has to approve your request. If however you don’t have a manager, then the approval step should be skipped.

image

Flow has an action for retrieving a users manager, so that part is easy. However, if the user does not have a manager, the Flow action will fail. The solution here is to add a parallel branch below the Get manager action. In one path you set the action to run if the previous action failed, in the other if the previous action was successful, like the image below.

image

Friday, October 13, 2017

Using Flow to promote better document sharing and collaboration in your organization

During lunch today I mentioned a customer sending me a document attachment in an e-mail, instead of what clearly should have been a sharing link to the file.

Outlook has excellent capabilities for sending sharing links instead of attachments, and especially internally in organization this should be the preferred approach to avoid e-mail bloat and multiple versions of the truth. Forcing people to change is not easy, but the conversation let to the following Flow urging your colleagues to do the right thing :)

image

Tuesday, October 10, 2017

Deploy a SharePoint Framework application customizer tenant wide

Creating application customizers which are available to all site collections is a very useful feature. Especially when it comes to site provisioning solutions. In my current project I’m creating a top banner which shows if the Office 365 Group is allowed to have external members, or if the team site can be shared with external users. This extension is installed on all new sites during creation.

Want to know more about a custom self-service solution for Office 365 Groups? Join me at ESPC November 16th 2017 where this post will be part of the solution demoed.

image

Wednesday, October 4, 2017

Adding images to SharePoint from a URL - mini life hack

Often you find yourself adding an image to SharePoint which you find on the internet. The upload dialog in SharePoint does not offer to link to a URL outside the domain you are on, so the workaround is to save the image locally, then upload.

At least if you are using Windows there is a quicker approach which usually works, and it also works in most other applications which allow you to upload a file.

Monday, October 2, 2017

Blocking vs. non-blocking Flows

Microsoft Flow has many triggers and one of the most useful ones is the HTTP request trigger, where an external party can call a specified endpoint with a message which will trigger the workflow. Basically this feature has two modes, one where the workflow executes logic and returns the outcome and the other where it does not need to return the outcome.

If you have an application which is translating text and you want the text back to the application you can create a Flow similar to the one below. A request which takes a string as input, the text is then translated to Norwegian, and returned at the end.

image

When running a REST query against the Flow URL using for example PowerShell we get the expected result back.

> $json = '{"thetext":"This is a test"}'
> Invoke-RestMethod -Method Post -Uri $uri -Body $json -ContentType "application/json"
dette er en test

This above operation is a blocking one. If you however want the translated text to be sent out as an e-mail, you remove the Response action and add an e-mail action.

image

When you now call the Flow URL you will immediately get a 200 success back, while the workflow executes the steps you have added. A non-blocking workflow.

Summary

If you want to use Microsoft Flow as an API in your application with input and output you can include both a Request and Response step. The calling application will then wait until a response is returned (or it times out). If you however want to use Microsoft Flow to execute an fire and forget action, omit the Response step, and the workflow will start executing while your calling application immediately can continue, regardless of what happens in the workflow.