- Home
- Guides
- AI Builder & AI
- How to scan shipping labels to Excel with Power Automate and AI Builder
How to scan shipping labels to Excel with Power Automate and AI Builder
Take a photo of a shipping label in the Power Automate mobile app and an AI Builder prompt pulls out the tracking number, service level, weight, reference, pieces and both addresses, then adds them as a new row in Excel.
Jump to a step (10)
Receiving desks, returns teams and small shippers copy tracking numbers and addresses from every label into a spreadsheet by hand. It is slow, typos creep in, and a barcode scanner only captures the tracking number, not the rest of the label.
This build has three parts: a custom AI Builder prompt that reads a label image and returns JSON, an Excel table in OneDrive for the shipping log, and an instant cloud flow that you run from your phone.
When you run the flow, you take a photo of the label. The flow sends the image to the prompt, adds the current time and your name, and writes one row to Excel in a few seconds. The same method works for invoices, equipment tags and other documents.
What you need
- Microsoft 365 with Power Automate
- Access to AI Builder prompts (AI Builder credits or capacity in your environment)
- An Excel workbook in OneDrive for Business with a table for the shipping log
- The Power Automate mobile app on your phone
- A sample shipping label image for testing
Step by step
0 of 10 done-
01
Create a custom prompt in AI Builder
In Power Automate, go to AI hub and select Prompts. Choose Build your own prompt.
In the instructions, ask the model to extract these fields from the image: tracking number, service level, weight, PO or reference, pieces, to address and from address. Add these rules:
- Return an empty string for any field that is missing, so the output always has the same structure.
- Replace any line breaks or tabs in the addresses with a comma, so each address fits in one Excel column.
- Keep the address parts in this order: name, address, city, postal code, country.
You can extract more fields, or split the address into separate columns, if you need to.
-
02
Add an image input and set the output to JSON
Delete the document placeholder text in the prompt. Click Add content and choose Image or document, then upload a sample label.
The default model (GPT-4.1 mini in the video) handles this task well. Under Model response, change the output format to
JSONso Power Automate can map each field. -
03
Test and save the prompt
Click Test. After a few seconds you get JSON with every field you defined and the addresses formatted on one line. Rename the prompt to
Shipping Label Extractorand save it. -
04
Create the flow with a file input
Click Create > Instant cloud flow. Name it
Shipping Data Log, choose Manually trigger a flow and click Create.In the trigger, click Add an input and choose File. The flow now asks for a file each time it runs, and on your phone that means you can take a photo.
-
05
Prepare the Excel file
In Excel for the web, create a blank workbook named
Shipping Log. Add a header for each field from the prompt, plus two optional columns: one for the date and time the label was scanned (Received At) and one for the Microsoft 365 user who scanned it (Receiver).Select the range, choose Format as Table, pick a style and tick My table has headers. The table is named
Table1by default. You can rename it on the Table Design tab. -
06
Run the prompt on the uploaded image
Back in the flow, add Run a prompt from the AI capabilities group (or search for it). Select
Shipping Label Extractor. For the image input, choose Enter the data from previous step, expand See more under the trigger and select the file content (contentBytes). -
07
Add the scan time and user name
These two values are not on the label. Add the Current time action to capture when the flow runs. Then add the Office 365 Users action Get my profile (V2) to get the name of the person running the flow.
-
08
Map the fields to Excel
Add the Excel Online (Business) action Add a row into a table.
- Location:
OneDrive for Business - Document Library:
OneDrive - File:
Shipping Log.xlsx - Table:
Table1
Open Advanced parameters and tick all your table columns (you do not need
DateTime Format). Then map:Received At: Current timeReceiver: Display name from Get my profile (V2)- Tracking number, service level, weight, PO or reference, pieces, to address and from address: the matching fields from Run a prompt (expand See more)
Save the flow.
- Location:
-
09
Test from the desktop
Click Test > Manually > Test > Continue. Click Import, choose a label image and click Run flow. When it finishes, open the Excel file and check that each value landed in the right column.
-
10
Run it from the mobile app
Open the Power Automate mobile app. Find the flow, tap the three dots and choose Run flow. Tap the file content field, choose to launch the camera, take a photo of the label and tap Use photo. Tap Run flow. A few seconds later a new row appears in Excel.
Tips and common problems
- Ask the prompt to return empty strings for missing fields. Not every carrier's label has every field, and a consistent JSON shape keeps the Excel mapping from failing.
- Multi-line addresses will not fit neatly in one cell. Tell the prompt to replace line breaks and tabs with commas.
- Set the prompt output to JSON. Plain text output cannot be mapped field by field in Power Automate.
- Want a record of the original label? Save the captured photo to a OneDrive folder and add a column for the photo link, so someone can review it later.
Quick version
The one-minute short shows the finished result: open the Power Automate mobile app, photograph a shipping label, and AI pulls the tracking number, addresses and service level into your Excel file. The steps on this page walk through the full build.
Questions
Can Power Automate read a shipping label from a photo?
Yes. A custom AI Builder prompt with an image input reads the whole label, including both addresses, and returns the fields as JSON. The flow then adds them to Excel.
Is AI Builder included in Microsoft 365 Business Standard?
Not on its own. The Run a prompt action uses AI Builder, which is a premium capability that consumes AI Builder credits. Check that your environment has credits or a trial before you build.
Can I use the same flow for invoices or equipment tags?
Yes. Change the fields in the prompt and the Excel columns to match the document, and the rest of the flow stays the same.
