Shipped to First Release: Flow integration for SharePoint document libraries

Microsoft

I am happy to announce that we shipped Flow integration for SharePoint document libraries as well as the ability to launch flows interactively to our First Release users and tenants today. If you are a First Release user, or have your tenant marked as a First Release tenant, you should be seeing a Flow button in the command bar of your modern document libraries. 

 

This integration helps your users automate repetitive tasks such as moving an email attachment into a document library folder, sending a selected item for feedback, posting to Yammer, or integrating files with other Microsoft or third-party services that Flow can access.

 

We will continue to make Flow integration better for document libraries over the coming months. Some of our plans include better support for all SharePoint data types, new actions that allow for sharing items, and new templates that make use of these additional capabilities.

 

This is also a great time to review some of the guidance on the governance for Flow as mentioned in our announcement:

 

We recommend that Office 365 Admins review the data loss prevention (DLP) capabilities for Microsoft Flow. All Office 365 Admins can sign into the Flow administration site without the need for any additional licenses, and set up rules that determine how data can flow between different Office 365 components (such as SharePoint, Outlook, Yammer) and other Microsoft and third party services. If you need more specific guidance on DLP and controlling user access to Flow, please check out our blog post announcing the general availability of Flow in Office 365 from last year, which covers these frequently asked questions.

 

We will monitor the usage patterns and telemetry, and continue rolling out these features to our production users over the coming weeks. Next step will be to roll it out to 50% of production tenants.

 

Please give these new features a try and let us know what you think. 

35 Replies
Thanks to @Kerem Yuceturk for helping solve my tenant's problems with this. Above and beyond so a little public thanks for the help behind the scenes. Much appreciated. Teamwork makes the dream work.@Chris McNulty @Mark Kashman @Jeff Teper

Thanks @Philip Worrell for the vote.

 

And thanks @Kerem Yuceturk for the detailed post.

 

Certainly looking forward to the improvements you mention especially from the PowerApps side. In the meantime, your details re the library meta-data looks interesting. I'll see what I can do.

 

Thanks again.

Hello @Kerem Yuceturk.

 

When I enter the library name manually, I can now see the meta-data / columns:

 

2017-04-03 15_06_17-Manage your flows _ Microsoft Flow - Internet Explorer.png

 

However, only Yes/No and Dropdown columns seem to be output in the flow. Single-line text columns are missing! For example, I have created the following flow:

 

2017-04-03 14_55_45-Manage your flows _ Microsoft Flow - Internet Explorer.png

When I add an item (which is a custom document type - word docx) to the library, the flow runs successfully and the email is delivered. However, the Project Number (text), Project Name, Scope and Address in the email are blank.

 

When I check the Outputs for 'When new item is created', the above columns are not listed. The only columns listed (in addition to the standard 'Created' etc.) appear to be Yes/No or Dropdown columns. I also wonder if only the default values of choice columns are being Output but have not checked this yet.

 

It seems really odd that text columns are not Output while choice columns are. Which makes me wonder if I'm doing something wrong. Am I doing something wrong? Or is this another thing on the roadmap for libraries?

 

Thanks.

My apologies. I should do more research before posting.

Text columns ARE output correctly when i use the standard 'Documents' library that was automatically added when Team site was created. I added some text columns and these are output to the email correctly. I have not modified document types or added any custom document types to this library.

Perhaps my problem is related to the my use of custom document types. I will try to investigate further.

Hi @Ian Macnaughtan, do let me know if you run into issues. 

Thanks @Kerem Yuceturk.

 

Let me know if I should post this in a new thread but this is my experience so far after spending quite a few hours on this since my previous emails. For reference, this is the flow I'm using to test:

 

2017-04-04 17_30_30-Clipboard.png

 

The trigger is linked to a library by typing in the library name manually (as suggested earlier).

 

It appears that the 'When a new item is created' trigger for a library fires before the custom columns are edited. This explains why the columns included in the 'Send Email' action have no values. Except where a default value has been defined for that column. In addition, the 'Create Item' action creates a list item with blank columns.

 

To stop this trigger firing until after the column edits, I have tried a variety of things like:

 

1. Make a column required

2. Change library to classic experience and require full dialogs

 

The New, Upload and Drag options all seem to work the same way - trigger fires as soon as the file is added to the library but before the columns are edited.

 

I then started looking at the 'When an existing item is modified' trigger. As you would expect, this trigger fires when each field is edited and saved. An interesting side affect of using the quickedit / details (?) pane in the new library experience is that my test flow generates an email when each column is edited and saved, with an increasing level of detail in each email - 5 column edits equals 5 emails. In order to get a single email with all edits, I have to use the 'Edit All' option to edit multiple fields before saving.

 

Unfortunately, this is where I think I've hit another road-block. As PowerApps cannot access library meta-data, I wanted to create/modify an item in a list whose columns match the library columns. And link PowerApps to this list. Unfortunately, there does not appear to be a way to match a list item with the library item being modified. For example, here is the rough logic:

 

When library item is modified

IF matching item already in the list

THEN Modify list item

ELSE Create list item

 

Perhaps I can use a loop to search the list but have not investigated this yet.

 

In the meantime, please fastrack the PowerApps <> Library integration! :)

Thank you @Ian Macnaughtan for the detailed write-up. It's not perfect but one way to overcome the multiple columns being edited is to wait for a while after the new item trigger fires if time criticality is not an issue.

 

Here's what that could look like: I use the same trigger, but then wait for 3 minutes to allow for the user to fill in the data (maybe adjust this value based on the complexity of the form). Then I do extra get item to get the latest updated values (new item will only have the initial value that's set), and use the values from GetItem in my email. This may be sufficient already, but if you really want to make sure the item is not being edited any more, you could also do a more complicated do until where you check if the last modified time of the item changes within a window, and only send it out afterwards.

NewItemWithDelay.PNG

 

I hear you about the PowerApps being able to connect to libraries. It is on the roadmap, but not coming as soon as some other improvements. We don't have an estimate for it yet.

Thanks @Kerem Yuceturk.

 

Good ideas that I'll definitely look at.

 

I may have also just found another way. In the library new item flow, I create an item in my list (as before) but now I also write the ID of the new library item into a list column called LibraryID (probably should be called LibraryItemID). :)

 

Like this:

 

2017-04-05 17_54_40-Clipboard.png

 

Then in the library item modified flow, I get the matching list item (created earlier) with an odata filter using the Library item ID I stored earlier using the new item flow. Like this:

 

2017-04-05 17_47_44-Manage your flows _ Microsoft Flow - Internet Explorer.png

2017-04-05 17_50_23-Manage your flows _ Microsoft Flow - Internet Explorer.png

 

 

This looks like it might work for me but relies on the flows running and in sequence. If the new item flow doesn't run then 'Get items' in the update flow will not find the list item and skip that step. I'm not sure yet if Flow enables me to do something if an error occurs.

 

Please let me know if you can see any other problems that should make me rethink my approach.

 

Thanks again for your help.

I've also hit the Quick Edit challenge. I've overcome it by adding a field and a condition check that acts as the switch to trigger the flow. However I'm not sure how it works in Flow's run time consumption model. For example, as you observe editing 5 columns in Quick Edit mode triggers the new item flow which terminates (with a success) as the switch is set to not run. Switching the switch causes the flow to run again so that's 5+1 flows which when scaled out could chew through Flow credits.

In the images below the internal name of my column with the switch is called 'reqapp' and it's display name is Request approval. Also another gremlin is the processing of Yes / No fields in conditions. The condition will only work if in advanced mode and the '' are removed from TRUE as shown below.

 

New item with switch as first conditionNew item with switch as first conditionFlow watching for changesFlow watching for changesNew item with switchNew item with switchQuick editQuick edit

@David Rosenthal - Thank you for your input.  I have good news to share -- In the Yammer App Directory, "Microsoft PowerApps and Flow" is now a 1st party app. You should have access, even if you've disabled 3rd party apps. 

 

This is awesome news @Sabra Goldick, thank you! We will start testing this as soon as we can!

Hi @Simon Denton, thank you for sharing. I agree it's a concern the number of people in your organization is small and if a lot of people editing things using quick edit, then as you say, running out of Flow quota can be an issue. We don't have a good way of being able to tell if an edit is the final one, or if another one is coming soon after. It's something to consider in future updates for sure.

 

I've filed a bug about boolean fields. Writing bool(0) or bool(1) in your conditions without going to advanced mode will work, but that's not at all intuitive. 

Thank you. I'll test using bool(0) method

It's a little confusing that the list of Flow templates is completely different after clicking on "create a flow", depending on whether or not a file was selected. If a file was selected, then the trigger is a "requst/response" that posts to Azure and returns the item ID and file url. If a file was not selected when clicking on "create a flow", then the trigger varies based on the selected template, but one option is the "when a file is created". This trigger is known to have significant shortcomings as it lacks the ability to access SharePoint metadata. So, we are left with two scenarios:

 

1. Create a flow that has access to metadata, but has to be manually triggered by users.

 

2. Create a flow that starts automatically, but has no access to metadata. 

 

I'd guess that most shops building workflows will want access to both of the above, the ability to start a workflow automatically as well as the ability to access metadata. 

 

I see that it was said that accessing metadata from a library-based flow is a feature that was being worked on. Is the current variation what was referenced? Or are there plans to support accessing metadata from automatically started Flows?

Hi,

 

Has this been implemented yet ? I am facing the same issue where I would like the same Flow to be triggered from multiple document libraries.

 

Thanks

 

Chris