Microsoft FLOW , best practice?

having used FLOW for some period now , I would like to share my experience , to save others my frustrations !!

Before I start creating flows, I create a FLOW user. flow@domain.xxx  . All updates done to data , is then clearly stamped with : UPDATED by flow. Not all users like to see names of users they feel are outside the process.  It also only have permissions required for objects to be included in flow.

The first step, is a trigger as it has to be, it can be a scheduled trigger , or an event .

MY FIRST MANDATORY STEP , is a check to see who triggered the flow .  You might want to do different things , based on who triggered. Also in some cases with multiple updates in one flow (NO NO !!) You might by accident trigger the flow from the flow…

Strangely it seems to work without re triggers on short flows, but as they take longer time, they re trigger.. So if  Modified by eq flow@domain.xxx  , then terminate. 

MY SECOND MANDATORY STEP , is to define the variables  for what we would call arguments in old fashion procedures.

Each  variable is set to their default value, it is the unchanged input value from the trigger. This means that if code to come can change , or leave as if ased on logic in that code.

MY  THIRD MANDATORY STEP , is the SWITCH. In each item in SharePoint eg. , I have a SWITCH variable that  normally  is «Ok» , but that end user can set to other values to trigger actions from the flow.

On new item typically it would be «new-fix» or something.  The switch then  routes to code required .

In each block in the switch I save files , update in other tables etc etc , but never updates in the item that triggered the flow. Procedure is to  the variables from the second step.

The fourth step, is the to update record in trigger item .  it might not bee needed , but at least it should rewrite SWITCH variable back to ok .

So… some last word : I insert send mail statements, as I would have done with break points. I use create CSV table to send myself a full  csv file of input data . I might even include a «DEBUG» variable, so that I can turn debug on or off without having to modify code.

Flow is not for the inexperience.. but 80% of functionality that you would use flow to create , is type of reminders. When is the certificate no longer valid, when should the HMS report be completed …  and so on..

For simplicity there is a fourth (first of fourth)   selection on the flow button… IF your list , or library contains a date field .  Its «SET A REMINDER» . You are asked for which variable to use, who to remind (email) , and the flow is then generated. EASY entry point , and nice .

 

 

 

 

Why is Microsoft Flow combined with FTP so SLOW !!

A very simple flow. Get some items , create a csv file Send as an email, and use standard FTP to post to a publishing server running LAMP. This is part of my attempt to make simple integrations between Office365 and both Joomle, WordPress and other web solutions using simple methods and old NETSCAPE portal thinking.. sort of …

Took me 10 minutes to get flow up and running, and 3 days to make it work… To transfear 2 Kb of updates , it used more than 38 minutes ! When I looked at the file it was oscillating between 0 and 2 KB . Sometimes it was almost ok, mostly not.

Connectors in Flow , can be configured as connectors under settings on flow dashboard, what took me so long was that the specific settings used on each operation are stored in that operation itself .

«Large messages may be split up into many smaller requests to the connector to allow large message upload and download. Details can be found at http://aka.ms/logicapps-chunk.»

And the limit before this should trigger is 50 MB , but that is not true…

It chunked my file all the time, and crashed transfer, and restartet … again… and again…

Turning CHUNKING of , reduced upload time from 38 minutes o 12 seconds…