When you have been using Microsoft Flow for a while and you implement business critical processes then you might find that the multiple environments in Flow works well, as you can create multiplSetting the site url with a switch e copies of your flows and keep them separated. Quite quickly however you will also want to separate your data.

But one of the problem when you separate your data is that you can’t easily copy your flows between the environments anymore. Yes of course you could copy the flows but you want the Development flows to access data in a development SharePoint site.

In my case I created 3 site collection a production site collection in /sites/ftp, development in /sites/devftp and uat in /sites/uatftp

Then using the following expression I collect the first 34 characters from my site collection so that I can recognise the environment I’m in.

substring(triggerBody()?['{Link}'],34,3)

Adding this to a switch and then I set the Site url within set variable actions. All easy stuff!

 

Get file properties is happy to take this and it looks like there is no pain in this post!

Get file properties with dynamic content

Then I tried to do an update file properties actions.

Cannot evaluate the parameter 'dataset' at design-time; it is empty or has a runtime expression

Cannot evaluate the parameter ‘dataset’ at design-time; it is empty or has a runtime expression.

Obviously this is because Microsoft Flow cannot find the fields on the library as it doesn’t know which library to look at. So what to do?

The easiest solutions that I can thing of are:

  1. Use REST API to do the Item/File properties updates ( for the real developers)
  2. Put a switch above the update file properties and depending on which environment we are in use a different update file properties action (for the less development focused FLOWers)
  3. Ask someone who has done it before to do the work for you 😉 (https://triad.co.uk)

In my solution I decided to go for the HTTP request to SharePoint options.

If this looks too complicated? Then you might want to go for option 3. Or wait until I get the 2nd part of this series written up.

 

Advertisements