For this article, we are going to be focusing on how the Vespa Group Development team created custom Microsoft Flow (Flow) to automate the printing of shipping labels directly from Microsoft Dynamics 365 (Dynamics).
The goal was to eliminate the manual process of weighing shipments, printing labels, tracking shipments, and maintaining the records within Dynamics.
The business process
Suppose you have shipping addresses stored in a Dynamics 365 records, that are regularly used for printing shipping labels. The old way of business probably involved switching between applications, possibly some copying and pasting, and several minutes later you have a printed shipping label.
Here we show how you can streamline package shipment by printing shipping labels with a single mouse click… all without leaving your Dynamics or PowerApps application. Leveraging Microsoft Flow, and a couple customer connectors, you can have a UPS shipping label printed in a matter of seconds.
At a high level
The Address record is opened within Dynamics 365, the user clicks the Flow option on the top menu and selects the Print Shipping Label option. The Print Shipping Label Flow is kicked off and begins the automated process:
- Weigh the shipping box on a digital scale via PrintNode
Generate a UPS shipping label and tracking number with the UPS API
- Print the shipping label at a local printer via PrintNode
- Update the Address Entity within Dynamics with the UPS tracking number.
The Flow steps are as followed:
In the example below, the Address entity is known as “Jobs”
- Create an initial step of “When a record is selected” action from the Jobs Entity in Dynamics.
- Setup necessary variables to used in subsequent steps in the Flow.
- Using the PrintNode API get the weight of the package on the digital scale. The digital scale is physically located in the Lab and configured within PrintNode as a Scale with a specific Scale Name.
- The weight is recorded (ounces) and parsed by a Parse JSON step as a successive step in the Flow.
- The UPS API is called to create a shipment with the current Address information, package weight, and other relevant data from current Job Entity record that is selected in Dynamics.
- Upon a successful response from the UPS API, a graphic image of the Shipping Label is parsed from the response. This graphic image format is ready to be sent the Printer.
- The next step in the Flow, is to call the PrintNode API and print the shipping label with the Graphic Image provided by the UPS API response from the previous step.
- The UPS Shipping Label is physically printed at the local printer within the Lab by the PrintNode service.
- Finally, the record in the Jobs Entity is updated with the tracking number to the Tracking Number Field in the Entity.
- The user picks up the physical UPS shipping label, applies it to the box and readies the box for shipping back to the Customer. Ship it!
Some Lessons learned:
- Logical validation steps are required at every major step in the Flow.
- If a step fails, the validation step can alert the staff of a problem with a specific error message to help remedy the issue immediately. The more detailed the error message the better!
- If an error occurs, add a step in the Flow to email staff with this error message.
- An example of a validation step is to validate the response of an HTTP response with HTTP status codes or similar rules. If this step passes, the continue to the next step in the Flow.
- These logical Flow Steps in Microsoft Flow are the real power of Flow.
- PrintNode is an awesome service and is easy to configure and setup.
- We recommend you setup several printers and scales during the implementation to allow thorough testing of your API requests.
- Make sure the digital scale is powered on before you kick off the Flow. The PrintNode service cannot call a scale that is turned off. Some digital scales turn off automatically after a few minutes.
Logical Steps in the Flow.
Implementing the UPS API and PrintNode API we created the Flow to ensure a seamless user experience for the user.
Logos above are copyright of their respective companies.
Need a similar solution implemented?
Contact Vespa Group today for more details:
email@example.com or call +1 317-360-5736