Use Microsoft Flow to let your office workflow automatic

Ref:

Introduce

What is Microsoft Flow? Someone might heard about (if this then that) that connected diversity cloud services together as flow, Microsoft Flow perform exactly same thing that providing trigger of chain operations on office suite ( Microsoft Office 365, Google Drive…), collaboration apps (Slack, Skype, Teams…) and storage (SQL, DB2…). You could find out what connectors does Flow support .

With Microsoft Flow, we could have our workflow script that build-up and design from the Flow portal, then we could connect to multiple services and write down some simply logic (if/for-each…) and hook and define inputs and outputs data from built-in functions or expression. The Microsoft Flow will help us trigger and complete the task as your expectation😊. The most important part is to save time for a software engineer that no need complete all stuffs by coding it-self BUT Microsoft Flow did it for us👏.

Simply sample

Suppose we have a report looks as below, this report with content that logs down every users status while users try to browser the web site for further tracking.

Users login status report

And we would like to having some task(s) that help us backup the records and wipe out history data for avoid them growing larger and bigger in the nearly future.

The ideal requirements as below:

✔ Query the record on the original report.
✔ Schedule to trigger backup and cleaning process for history data.
✔ After each process completed, sending notice message via mail or to channels(slack or teams) to someone whom subscribed.

We could create our flow on (login and you got your ) in different ways and apply for diverse conditions. The demo simply use instant flow.

We got three main flow for usually
Automated flow: trigger by source of event(s).
Instant flow: trigger by manually.
Scheduled flow: trigger by a time settings.
Create instant flow
Naming and create manual trigger
Demonstrate simplest flow
The above demonstrate how to build-up our first simplest flow:
1️⃣ User trigger the flow apps, let user input integer mode: (0/1).
2️⃣ If input equals to 1 goes yes flow, otherwise goes to no.
3️⃣ If yes: send mail to users.

Let’s back to user logs case. Here was the final design flow might looks:

Design for the scenario

We have three main branches for achieve the above requirements:
First we initialed the variable that get input from users, for instance the query history_days... then set the variable and list all logs according original logs report.

Next we used array filter for filtering the date time range’s logs record(s):

▶ Branch A: filtering logs history between time range from (date time now - history_days) to date time now, then passing the result to teams channel-1.▶ Branch B: filtering logs history of yesterday then create excel format file in share point-1 [use template for dynamic creating excel file(s)].▶ Branch C: filtering logs history of yesterday then create csv format file in share point-2 for backup purpose. The final step will delete the selected range data records from original report.Note
⭐ (Create XLSX document from template): this step need connect to third party API called: Plumsail, that's means the service was not for free🤣.

Conclusion

Microsoft Flow indeed powerful and easily for this kind of official automatic. And I got little experience after this demonstration:

📝 Not everything/functional support for the flow component(s), for instance dynamic create excel file...and it remains restriction or some feature not implement yet.📝 If you got issue or want to ask how to design your workflow, you could launch forums . Maybe you could got back some ideals or post question(s) for further inquiring.📝 Sometimes you might wonder how to use built-in function or expression that provide by Microsoft Flow, please take a look from .For example: formatDateTime(addDays(utcNow('MM/dd/yyyy'), variables('history_days')), 'MM/dd/yyyy')[The above example used built-in function to convert current date time plus with variable 'history_days']📝 Remember to click save each step while your are in edit flow page, I have encounter several time that "Flow checker" always told me I got connection error then I can't save my changed🤣.

Reference

Coding for fun

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Docker Compose and Typescript

3 Benefits of DevOps Metrics within Engineering Teams

{UPDATE} 全民五子棋(五子棋聯機,五子棋大師,五子棋對戰) Hack Free Resources Generator

Top Software Testing Solution Companies

C #: from the basics to the medium level (Type Convertion & Overflow)

SOLID Design Principles redefined

1. Web Scraping Using Python

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
LAI TOCA

LAI TOCA

Coding for fun

More from Medium

A simple git command to make your next release note

Comparing Shopware apps and plugins — BitBag

Magento Open Source vs Adobe Commerce: What Should You Choose

Readability Scores: Secrets Revealing, Improving Tips With Free Tool