cancel
Showing results for 
Search instead for 
Did you mean: 

Buttons, Excel, Approvals and notifications

Intro

Buttons, Excel, Approvals and notification in one MS Flow. Tracking a starting and end point into Excel, by triggering a button. This is a flow that I will talk about today!

The solution will have two Flow's that could be triggered by a button. The values will be added to an excel file that is stored on OneDrive for Business. By registering the starting point with address, start date, start time and also the information of end point. I could calculated travel times between the start and end point.

Flow05-01.png

How-to?

We have created a n Excel file that looks like this and contains followzing headers: StartAddress, StartDate, StartTime, EndAddress, EndDate and EndTime. __PowerAddId__ is used to create a unique id of the tracking line.

Using two MS Flow buttons to register the start and end point, including some checks to verify the current tracking status of the Flow.

Button: Start Travel Tracking

Overview flow:

Flow05-26.png

Flow05-02.png
Format Date: formatDateTime(triggerOutputs()['headers']['x-ms-user-timestamp'],'yyyyMMdd')
Format Time: convertFromUtc(triggerOutputs()['headers']['x-ms-user-timestamp'],'Romance Standard Time','HH:mm')

Adjust time to CET time.

Flow05-03.png

Getting the rows of an XLS file that is located on the OneDrive for Business.

Flow05-04.png

Getting the last row of the Excel file, by using following expression: last(body('Get_Rows')?['value'])

Flow05-05.pngCreating an Array of the last row: array(Outputs('Last_Row_Excel'))
Flow05-06.pngAdd an Apply to each for the outputs of Array Last Row Excel

Flow05-07.pngIn the condition we check if the Start and End Date has been filled in, when filled in we need to add a new row, else we notify that the travel tracking was already started and not been ended correctly.

[YES]

Flow05-08.png

StartDate: Outputs[‘Format_Date’]
StartTime: Outputs[‘Format_Time’]
__PowerAppsID__: triggerOutputs()[‘headers][‘x-ms-user-timestamp’]

Flow05-09.png

[NO]

 

Flow05-10.png

Approval notification will be sent to the mobile app, for the question [Stop Travel Tracking?]

Flow05-11.png

[YES]

Flow05-12.png

Format Time End: convertFromUtc(body('Current_Time'),'Romance Standard Time','HH:mm')
Convert to CET Time

Flow05-13.png

Last Row Excel End: last(body('Get_Rows_End')?['value'])
Array Last rowExcel End: array(outputs('Last_Row_Excel_End'))

[NO]
Do nothing

Flow05-14.png

Second Button - STOP TRAVEL TRACKING

Overview Flow:

Flow05-27.png

Flow05-15.png

Format Date: formatDateTime(triggerOutputs()['headers']['x-ms-user-timestamp'],'yyyyMMdd')
Format Time to West Europe (CET): convertFromUtc(triggerOutputs()['headers']['x-ms-user-timestamp'],'RomanceStandard Time','HH:mm')

Flow05-16.png

Get lastrow of the Excel file
Last Row Excel: last(body('Get_Rows')?['value'])
Array Last Row Excel: array(outputs('Last_Row_Excel'))
Flow05-17.pngFlow05-18.pngFlow05-19.png

[YES]

Flow05-20.pngFlow05-21.pngFlow05-22.pngFlow05-23.pngFlow05-24.pngFlow05-25.png

When the End Date has been already filled in we notify by sending a notification towards the Microsoft Flow app.
Enjoy! Feedback is welcome
Like, Share!
Would you like more of these Flow examples? Suggestions are welcome ...

Comments

Thanks, very nice exemple 

Meet Our Blog Authors
  • Working daily with Microsoft Cloud to deliver the needs of my company, my customers and various Microsoft communities and forums. | Office 365 | Flow | PowerShell | PowerApps | SharePoint |
  • Co-founder of https://plumsail.com, Office 365 and SharePoint expert. Passionate about design and development of easy to use, convenient and flexible products.
  • Microsoft Business Apps MVP. Owner of ThriveFast, an Office 365 consulting company.
  • 7x Microsoft Business Solutions MVP (CRM)
  • Solution Architect with Slalom, and organizer of the Boston Office 365 User Group, and long term SharePoint/Office 365 veteren. Find more at http://www.davidlozzi.com. Follow @DavidLozzi
  • I'm keen in MS technologies, SharePoint, Office 365 and development for them
  • Daniel is a Business Productivity Consultant & Microsoft Business Solutions MVP who is very enthusiastic about all things Office 365, Microsoft Flow, PowerApps, Azure & SharePoint (Online). Since the preview, Daniel has been working with Microsoft Flow and later on with Microsoft PowerApps. That led to him being awarded an MVP Award for Business Solutions. He loves to blog, present and evangelize about improving productivity in the modern workspace with these amazing tools!
  • Michelle is an Office 365 solution architect in Twin Cities, MN. She has been delivering business collaboration solutions for years with her focus on SharePoint and Office 365. Michelle is a recent board member of the Minnesota Office 365 User Group and has been a member of the SharePoint community since 2009. She is a frequent speaker at MNSPUG and SharePoint Saturday and co-chaired the Legal SharePoint User Group for 4 years. Her most frequent projects have involved rolling out a large deployment of Office 365, SharePoint Online intranet, build of a "CHAMPS" Office 365 user adoption program and most recently, SharePoint On-Premise to Online Migration. Michelle is very excited about cloud technology as it is shifting her IT Pro focus to collaboration strategy and technical adoption.
  • I'm a Microsoft Office Servers and Services MVP with a special interest in SharePoint, Office 365, Microsoft Flow, Microsoft Teams and PowerApps. I work at Triad Group Plc ( https://triad.co.uk)