Skip to main content

Command Palette

Search for a command to run...

Automating Purchase Order Processing Using Power Automate Desktop

Updated
6 min read
Automating Purchase Order Processing Using Power Automate Desktop

Introduction

In real-world business scenarios, employees often spend a significant amount of time switching between multiple systems to complete repetitive tasks. One such scenario is processing purchase orders, where data must be collected from different applications and matched with external sources like Excel.

In this blog, I will walk you through a practical automation use case implemented using Power Automate Desktop, where a bot processes purchase orders by integrating a web application, another system for lookup, and an Excel file.


Problem Statement

A web application displays a list of Purchase Orders (POs). However, these POs are incomplete and require additional details such as:

  • Ship Date

  • Order Total

  • Buyer State

These details are available in another system called Procurement Anywhere.

Additionally, based on the State, we must assign the correct Agent, which is stored in an Excel file (Agent Territory Mapping).


Objective

Build an automation that:

  1. Extracts Purchase Orders from the main website

  2. Logs into Procurement Anywhere

  3. Retrieves Ship Date, Order Total, and State

  4. Reads an Excel file to map State → Agent

  5. Assigns the correct agent

  6. Fills the form and submits it automatically


End-to-End Flow

  1. Open the main challenge website

  2. Download the Agent Territory Excel file

  3. Read Excel data into a DataTable

  4. Log in to Procurement Anywhere

  5. Extract all PO numbers

  6. Loop through each PO

  7. Fetch details from Procurement system

  8. Map State with Excel to find Agent

  9. Fill details in the form

  10. Submit the form


Implementation in Power Automate Desktop

Let’s break down the automation step by step.

Code Link: Power-Automate-Desktop/Automation Anywhere Challenges/Purchase Order Updates - Supply Chain/code.txt at main · sunilshetty07/Power-Automate-Desktop


Note:

Step 1: Launch the Website

The bot starts by launching the main web page where purchase orders are displayed.

Launch Edge → Open challenge URL

This page contains the list of POs that need to be processed.


Step 2: Download Excel File

The automation clicks on the Download Agent Territory Spreadsheet button.

Press Button → Download Excel

This file contains the mapping of:

State → Assigned Agent

Step 3: Read Excel Data

The downloaded Excel file is opened and read into a DataTable.

Launch Excel  
Get Table Range  
Read Cells → ExcelData

Example:

State Agent
CA John
NY Mike

This data will be used later for mapping.


Step 4: Login to Procurement System

The bot opens a new tab and logs into the Procurement Anywhere system.

Populate Email  
Populate Password  
Click Sign In

Once logged in, the bot can search for PO details.


Step 5: Extract Purchase Orders

The bot extracts all PO numbers from the main page.

Extract List → PONumberfromWebsite

Example:

PO001  
PO002  
PO003  

Step 6: Loop Through Each PO

A loop is used to process each PO one by one.

LOOP FOREACH CurrentItem IN PONumberfromWebsite

This is the core logic of the automation.


Step 7: Fetch PO Details

For each PO:

  • Enter PO number in search

  • Extract details from table

Search PO  
Extract Table → DataFromWebPage

Extracted fields:

  • Ship Date

  • Order Total

  • State


Step 8: Fill Ship Date

The ship date is directly populated into the form.

Populate Ship Date → DataFromWebPage

Step 9: Process Order Total

The order total comes with a dollar symbol, so it must be cleaned.

Remove $  
Convert Text → Number

Example:

$500 → 500

Then populate it into the form.


Step 10: Map State to Agent

This is a key step.

The bot compares the state from the website with Excel data.

Find State in ExcelData

Example:

State = CA → Agent = John

Step 11: Assign Agent

The correct agent is selected in the dropdown.

Set Dropdown Value → Agent

Step 12: Repeat for All POs

The loop continues until all purchase orders are processed.


Step 13: Submit the Form

After filling all rows:

Click Submit

Step 14: Cleanup

Finally:

  • Close Excel

  • Delete downloaded file

This ensures the system remains clean.


Key Concepts Demonstrated

This use case covers important RPA concepts:

Web Automation

  • Launch browser

  • Extract data

  • Populate fields

Excel Automation

  • Read structured data

  • Perform lookups

Data Mapping

  • Match State → Agent

Looping

  • Process multiple records dynamically

Data Transformation

  • Convert text to numeric values

Real-World Relevance

This scenario is very common in industries like:

  • Supply Chain

  • Procurement

  • Finance

  • Operations

Instead of manual effort, automation can:

✔ Reduce errors ✔ Save time ✔ Improve efficiency ✔ Handle large volumes of data


Conclusion

In this automation, we built a bot that integrates multiple systems to process purchase orders efficiently. By combining web automation, Excel lookup, and decision-making logic, the bot eliminates repetitive manual work.

This is a great example of how Power Automate Desktop can be used to solve real-world business problems using RPA.