Intro:
With the buzz around AI, digitizing data has become essential for many businesses. Imagine you're working on a project to help your company meet sustainability goals. One key aspect is capturing Scope 2 data, which includes indirect emissions from the consumption of purchased electricity, steam, heating, and cooling. This data is crucial for CSRD reporting, as it helps companies understand their environmental impact and make informed decisions to reduce their carbon footprint.

Recently, I was tasked with extracting the fuel mix from utility energy bills to gather these valuable data points. Initially, I considered using custom AI Builder models, but due to cost and performance limitations, they weren't a feasible option. Then, I discovered the new AI Prompt capabilities in the Power Platform. This innovative feature sparked my interest, and I decided to explore how it could assist in capturing the necessary data efficiently and accurately.

Setting Up AI Builder Custom Prompts in Power Automate:
1) With power automate designer interface, launch AI Prompt , Click on Create and choose Custom Prompt.

Image description

Custom prompt leveraged and the output is setup as JSON for better data processing. The prompt is designed to guide an AI model in extracting specific information from a British Gas utility bill. It emphasizes the model's expertise in analyzing utility bills, particularly for British Gas, ensuring accurate and relevant data extraction. The prompt specifies the input as the text of the utility bill and outlines the exact details to be captured, including Account Number, Bill Number, Billing Period, Total Amount Due, Meter ID, Units Billed, and British Gas Fuel Mix. The output is required to be formatted as a structured JSON object, providing a clear and standardized representation of the extracted data. Additionally, the prompt includes instructions to indicate any missing or unclear information, maintaining transparency and accuracy. By providing an example output format, the prompt ensures consistency and precision in the results, making it a valuable tool for efficient data extraction.

You are a knowledgeable data extractor with expertise in analyzing utility bills, particularly for British Gas. Your task is to process a British Gas utility bill and extract specific information from it.
The input will be the text of the British Gas utility bill, and you should focus on capturing the following details from the specified sections:

Account Number
Bill Number
Billing Period
Total Amount Due
Meter ID
Units Billed (the difference between Previous Reading and Current Reading)
British Gas Fuel Mix (as key-value pairs from the Useful Information section)


The input will consist of the utility bill text:   Utility bill 
Please format the output as a structured JSON object that includes all the extracted details.

Make sure to maintain clarity and ensure that the data is accurately represented in the output. If any information is missing or unclear, indicate that in the JSON output.

Example of the output format:
{
  "Account Number": "",
  "Bill Number": "",
  "Billing Period": "",
  "Total Amount Due": "",
  "Meter ID": "",
  "Units Billed": "",
  "British Gas Fuel Mix": {
    "Gas": "%",
    "Electricity": "%",
    "Other": "__________%"
  }
}

Be cautious not to misinterpret any figures or details and ensure that your extraction is precise and consistent with the provided information.

Image description

2) Integrate the Prompt with Power Automate: On the new designer leverage the "Create text with GPT using a prompt" action and map the Custom prompt built in the first step

Image description

Observation of the test:
After implementing the AI Builder custom prompt for extracting data from British Gas utility bills, I conducted a series of tests ( 10 documents) to evaluate its performance and accuracy. The results were impressive, demonstrating the capability of AI Builder to handle complex data extraction tasks efficiently.

Custom Entity extraction model AI Prompt Model
Run Time Credit Run Time Credit
Utility Bill 1 19.95 400 8.43 120
Utility Bill 2 19.52 400 8.99 116
Utility Bill 3 18.33 400 9.21 112
Utility Bill 4 19.42 400 9.66 107
Utility Bill 5 19.90 400 10.11 104
Utility Bill 6 18.80 400 9.88 102
Utility Bill 7 19.73 400 10.66 99
Utility Bill 8 20.47 400 9.77 97
Utility Bill 9 20.36 400 9.78 94
Utility Bill 10 21.59 400 9.50 91

The AI credits can be captured from the dataverse AI EVENT

Run Time: The AI Prompt model consistently demonstrated faster run times compared to the custom entity extraction model. This efficiency is crucial for processing large volumes of data quickly.
Credit Usage: The AI Prompt model also showed significantly lower credit usage, making it a more cost-effective solution for data extraction.

The AI Prompt model not only enhances performance by reducing run times but also offers a more economical approach with lower credit consumption. This makes it a valuable tool for businesses looking to optimize their data extraction processes while managing costs effectively.

Further Read
AI Builder
Custom Entity Model