Process Automation: Printing Shipping Labels Directly from Microsoft Dynamics 365 (or PowerApps)

Thursday, April 11, 2019

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.

Microsoft Dynamics 365

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.

In the below example, we have a custom entity called “Jobs” that stores the shipping address. The user selects a record, clicks on the Flow button, and Flow does the rest!

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:

  1. Weigh the shipping box on a digital scale via PrintNode
  2. Get the package weight from the PrintNode API Scale.

    Generate a UPS shipping label and tracking number with the UPS API

  3. Print the shipping label at a local printer via PrintNode
  4. 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”

  1. Create an initial step of “When a record is selected” action from the Jobs Entity in Dynamics.
    Overview of Flow
  2. Setup necessary variables to used in subsequent steps in the Flow.
  3. 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.
  4. The weight is recorded (ounces) and parsed by a Parse JSON step as a successive step in the Flow.
  5. 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. 
  6. 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.
  7. 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.
  8. The UPS Shipping Label is physically printed at the local printer within the Lab by the PrintNode service.
  9. Finally, the record in the Jobs Entity is updated with the tracking number to the Tracking Number Field in the Entity.
  10. 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:

  1. Logical validation steps are required at every major step in the Flow.
    Logical Steps 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.
      Update the Tracking Number field in the Jobs Entity.
  2. 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:

info@vespa-group.com or call +1 317-360-5736