Logistics Automation - Routing Task Assignment
Bala Madhusoodhanan
Posted on March 7, 2023
Routing Task Assignment:
A workflow app for parcel logistics that allows users to self-check-in parcel tasks and also provides routing recommendations could have several benefits for both the logistics provider and the end customer
Conceptual Architecture View:
Platform Setup:
Added 2 more columns to the share point list. One a choice which would capture the Status of the Order and another column to capture the user Email ID to select the assigned task
Bing as a Data Connector:
Its a premium connector
Enabling Map Controls / Geospatial:
https://learn.microsoft.com/en-us/power-apps/maker/canvas-apps/geospatial-overview
Enabling Barcode Control:
Setup the Scanner:
Scanner barcode Control:
This out of the box control enables you to read barcode which was created in the previous step. To access the barcode data leverage the below code
BarcodeScanner1.Value
Routing Recommendation:
1.First it to get the Origin and destination postcode for the sharepoint list site based on the barcode scanned.
LookUp(GeoMap,'Consignment ID'=BarcodeScanner1.Value).FromAdd
2.Once I save both the origin and destination postcode for the Routing recommendation task the next step is to get the Longitude and the Latitude for the post code.
BingMaps.GetLocationByAddress({postalCode:OrginPost_1.Text}).point.coordinates.latitude
BingMaps.GetLocationByAddress({postalCode:OrginPost_1.Text}).point.coordinates.longitude
3.Create a table as a variable on the screen to pass the value to the Map control
Set(SCMapTemp,Table({Latitude:BingMaps.GetLocationByAddress({postalCode:OrginPost_1.Text}).point.coordinates.latitude,
Longitude:BingMaps.GetLocationByAddress({postalCode:OrginPost_1.Text}).point.coordinates.longitude},
{Latitude:BingMaps.GetLocationByAddress({postalCode:DestPost_1.Text}).point.coordinates.latitude,
Longitude:BingMaps.GetLocationByAddress({postalCode:DestPost_1.Text}).point.coordinates.longitude}))
4.The above step (getting the co-ordinates) could be ignored if you already have the longitude and latitude data which would mean you need not configure the BingMaps data connector. Now insert the Map controls and pass the above table as data point to get the routing recommendation
Enable Routing on the Map control
1.Add the data source
2.Get the distance from the Map control (data always in meters)
Concatenate((Map2_1.RouteDirection.LengthInMeters)/1000," KM")
3.Get the time from the Map control (data always in seconds)
With(
{
varTravelTime: Time(
0,
0,
Map2_1.RouteDirection.TravelTimeInSeconds
)
},
With(
{
varHours: Hour(varTravelTime),
varMinutes: Mod(
Minute(varTravelTime),
60
)
},
Coalesce(
Concatenate(
If(
varHours <> 0,
Text(
varHours,
"0"
) & " hr "
),
If(
varMinutes <> 0,
Text(
varMinutes,
"0"
) & " min"
)
),
"0 hr"
)
)
)
The Routing recommendation would looks something as below
Task Checkout:
Adding a self checkin button to perform the below 2 tasks. Have leveraged the Office connector to get the user id
- Update the sharepoint list Order status and enable the user to assign the task
Patch(GeoMap,LookUp(GeoMap,'Consignment ID'= BarcodeScanner1.Value),{Status:{ Value: "03"}});
Patch(GeoMap,LookUp(GeoMap,'Consignment ID'= BarcodeScanner1.Value),{AssignedTo:User().Email})
- Send an email to notify the user
Office365Outlook.SendEmailV2(User().Email,"ConsignmentID :" &BarcodeScanner1.Value,
"Dear :" &User().FullName& ","&
"The Self Check-In is now completed. Proceed to deliver the order" &
"<br>" &
"<h3>Job Information Details </h3>" &
"The Consignment ID Reference :" &BarcodeScanner1.Value &
"<br>" &
"The Pick Up Location Postcode :" &OrginPost_1.Text &
"<br>" &
"The Drop off Location Postcode :" &DestPost_1.Text &
"<br>" &
"Estimated Time for Travel :" &EstTimeV_2.Text &
"<br>" &
"Estimated Travel Distance :" &EstDistV_1.Text
);
Task self checkout would look something as below
Task Automation Benefit:
Improved efficiency: With a self-check-in feature, the logistics provider can save time by eliminating the need for manual check-in and processing. This can help to speed up the overall parcel delivery process and increase efficiency.
Reduced errors: By allowing customers to check in their own parcels, the likelihood of errors or mistakes in the check-in process can be reduced. This can help to improve accuracy and ensure that parcels are properly accounted for.
Enhanced customer experience: A self-check-in feature can provide customers with greater convenience and flexibility, as they can check in their parcels at their own convenience. Additionally, routing recommendations can help customers to choose the most efficient and cost-effective delivery options, which can help to improve overall satisfaction.
Product Documentation:
Barcode Scanner Control:https://learn.microsoft.com/en-us/power-apps/maker/canvas-apps/controls/control-new-barcode-scanner
Bing Maps Connector: https://learn.microsoft.com/en-us/connectors/bingmaps/
Maps Control:https://learn.microsoft.com/en-us/power-apps/maker/canvas-apps/geospatial-component-map
Posted on March 7, 2023
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.