Difficulty in running an ad-hoc Flow against a File in a SharePoint Library (not List) - InfoPath Dev

InfoPath Dev

Use our Google Custom Search for best site search results.

Difficulty in running an ad-hoc Flow against a File in a SharePoint Library (not List)

Last post 01-30-2018 10:29 AM by merley72. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 01-29-2018 01:19 PM

    Difficulty in running an ad-hoc Flow against a File in a SharePoint Library (not List)

    In readiness for potentially converting bunches of SharePoint Designer Workflows (and in order to try and stay at least in touch with current Microsoft technologies) I’ve done a bunch of tests in Flow against SharePoint Online sites and subsites using both the pre-built Templates and tried my hand at building my own. Whenever I select a pre-built template such as ‘Start approval when a new item is added’, it only refers to Lists that are held on the site.  Other templates such as ‘Start an approval for new file to move it to a different location’ gives the user an option to select a Library which is great.

    However I want to initiate a Flow on a Library document (File), in an ad-hoc manner not upon either Creation or Modification – I want the option to be User initiated at a point of my choosing.  This is important when considering InfoPath based Forms in Office 365 as I need to potentially use these a number of times in different tenants.

    If I look at the Trigger options for creating a brand new Flow from nothing (i.e. not using a Template), I see ‘SharePoint – For a selected ITEM’ option which when I saw that, it gave me the hope of being able to activate it as I wanted, but no, it appears it can only be used on LISTS – unless I am really missing something very basic. I read in the information tab (the little ‘I’ in a circle to the right of the line), it says the following:

    • “This trigger allows you to start a flow for a selected item in a SharePoint list or library. You can use the columns of the list or library as output parameters. For a file, you can use the "identifier" column to get file content “

    I’ve tested the approach on list items and can run things in the ad-hoc fashion I’m looking for, however I cannot work out how I can use this trigger or any other method of activating a Flow on the Document / File in a LIBRARY.

    Can anyone please tell me what I am doing wrong and importantly give links to guidance etc to help me on my way. Thanks

  • 01-29-2018 02:18 PM In reply to

    Re: Difficulty in running an ad-hoc Flow against a File in a SharePoint Library (not List)

    When you select your SharePoint trigger, you just have to use a custom value for the Library name. There should be an option at the end of the list of list names for entering your own value. If your library is using Modern View, the Flow button is likely in the menu bar - I'd guess if you start in the library, you wouldn't have to enter a custom value - more here: https://support.office.com/en-us/article/create-a-flow-for-a-list-or-library-in-sharepoint-online-or-onedrive-for-business-a9c3e03b-0654-46af-a254-20252e580d01

    To run on demand (so to speak) I usually use some type of helper field from the form - user takes an action, set the helper field, use it in a condition to determine what action to take, and then reset it as part of the Flow.

    Hilary Stoupa

  • 01-30-2018 10:29 AM In reply to

    Re: Difficulty in running an ad-hoc Flow against a File in a SharePoint Library (not List)

    Thanks for the reply Hilary, and I’ve done a bit more testing of things these past days. 

    There are some good things to report, some (really!) bad ones and a few ugly bits as well.

    You are correct in that if you choose an appropriate 'Library' based Template from within a New Look View layout from the ‘Flow’ tab, then the site URL and Library name generally gets inherited correctly into the relevant fields.  However if the 10 or so templates presented don’t hold a relevant option, and you need to select one of the wider set of choices, then you need to add the name of the Library directly into the List Name field, or (and I think this is slightly safer) to use the GUID reference for the Library.  I struggled for a bit trying to remember how to find this out, however you can use the Flow options to advantage here.

    If you use one of the general options available under the ‘create a Flow’ drop-down such as ‘Request manager approval for a selected item’, once that is opened up and editable, you can select the top element of that (which in this instance is called ‘Get Item’) and it identifies the List ID reference number for the Library, in the ‘List Name’ field.  It’s then a simple copy and paste job with the ID number into the List Name field.

    I’ve played about a bit with the options of whether a Library or List uses the New Look View style or if it is set to Classic, and so far, I’ve found that it doesn’t matter which style you have the Flow still runs!  Now for some people that might be useful to employ as they perhaps are slowly moving to the New Look style, but the old is used as well.  You can set up Flows to run either through the drop-down option in the List itself or directly through the Flow interface and then revert to Classic.  Then so long as the Flow is a self-activated one (i.e. it activates when a field value changes, new document is added or item is changed etc) it will continue to run as needed regardless of the ‘front of house’ look presented to the Users – neat I think!

    What is a real nasty however, is that I’ve been told by MS support engineers, that a Form Library which is an XML Form Library, CAN NOT ever be altered to display in the New Look View approach – it is limited to being Classic view only.   I messed about with this extensively looking for the ‘List Experience’ option and checked in 3 different separate Office 365 instances, then finally in a Developer Office 365 site we have which has only ever been the New Look View and never Classic.  Whatever I did/where ever I was, if I created a new XML library or looked into an existing one they ALL displayed in the Classic style regardless.

    That means that it shouldn’t be possible to run Flows against Browser/InfoPath based forms in the Library – however it seems to be!  I’ve only tested this in two Browser form Libraries so far, and with a couple of different Template flows but if you add either the List ID or the name of the list directly into the ‘List Name’ field, then make the Flow to be one where a field change or new item activates it, it seems to work. 

    So I hope you see why I regard this as a bit good, bad & ugly. 

    Disappointingly of course, the lack of New Look View in an XML Library means you can never run an ad-hoc Flow when you want to.  However when I explained this limitation to the Microsoft engineer he suggested I get onto the User Voice site and see if others had mentioned these limitations and if there was a pressure group to try and ‘persuade’ MS to allow Flows directly against XML Form libraries.  Personally I’m not that hopeful but one never knows.

    Thanks for coming back to me though and I hope this helps other however please do test this for yourself (and anyone else who reads this I encourage to do the same) and any extra bits or aspects I’m wrong on / have a difference experience please come back to me.  Regards  Alan C.

Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.