Detect invoice data with custom fields (AI)

Extracts structured invoice data (seller, buyer, line items, totals, payment details) from an invoice using AI, plus up to 10 fields you define yourself. It reads PDF files, scans and photos (JPEG, PNG), Word (DOCX) and Excel (XLSX) files and text files such as TXT or CSV. Each own field comes with certainty, page and an optional check (IBAN, VAT ID, tax number, date, amount or your own format). Values that need a human look are marked with Needs Review.

Detect invoice data with custom fields (AI)
📄 The invoice as PDF, JPEG or PNG (scan or photo), as XML e-invoice, …
Show advanced options
Optional description of the document or hints for the AI, e.g. 'amo…
If true, 'Additional Instructions' replaces the default document ty…
Up to 10 own fields to extract in addition to the standard invoice …
If true, the top and bottom of page 1 are also sent zoomed in, so s…
If true, IBAN, VAT IDs and totals are checked; problems set 'Needs …
How often values are marked for review: Rarely, Normal or Often.▾
Auto: embedded e-invoice first, AI for the rest. Always AI. XML Onl…▾
Appearance of this action in the Power Automate designer (rendered from the connector definition).

Step by step: get the project number from an invoice

This action reads all standard invoice fields and, in addition, the fields you define under Additional Field. The example below shows how to get a project number from our sample invoice. The same steps work for a cost center, an order number or any other value on your documents.

Sample invoice of Muster Bau GmbH with project number P-204711

Download the sample invoice (PDF) and try it in your own flow. It has the project number P-204711 at the top right, the cost center KST-4711 in the invoice address and the bank details in small print in the footer.

Step 1: Start the flow with a file

Create an instant cloud flow with the trigger Manually trigger a flow. Choose Add an input and then File; here the input is called Invoice.

Trigger Manually trigger a flow with the file input Invoice

Any trigger that gives you the file content works as well, for example When a new email arrives (attachment) or When a file is created in SharePoint or OneDrive.

Step 2: Add the action

Below the trigger choose + and Add an action, search for invoice data with custom fields and select Detect invoice data with custom fields (AI) from the connector BILL Converter by Power2Apps.

Step 3: Choose the file and define your fields

Put the file content of the trigger into Invoice File. Open Advanced parameters and choose Show all. Under Additional Field you describe each value you want, one item per field.

Parameters: Invoice File and the first Additional Field Project number

For the project number we use:

With Add new item we add two more fields: Cost center (in the invoice address, after 'Kostenstelle:', no check) and Supplier IBAN (bank details in the footer, required, check IBAN). Below the fields, three settings control how the document is read and checked.

Parameters: more fields, Add new item, Read Header and Footer in Detail, Validate Standard Fields and Review Level

Step 4: Run the flow with the sample invoice

Save the flow, choose Test, then Manually. Select the sample invoice with Import and start the flow with Run flow.

Run flow with sample-invoice.pdf as Invoice

Step 5: Check the result

Open the run and the action. In the outputs you find the project number three times:

Outputs: values and details of the three own fields

Needs Review is false: all three values were found, both checks passed and the certainty is above the review level.

Step 6: Use the value in the next step

In the next step, for example Create item in SharePoint, a condition or (as here) Compose, open the dynamic content and search for Additional Field. Additional Field 1 Value is your project number, Additional Field 2 Value the cost center and so on, in the order of your fields.

Dynamic content: Additional Field 1 Value to Additional Field 6 Value

The settings in short

Each Additional Field has these settings:

Notes: what the action adjusted

The action does not reject your input when something does not fit: it uses the default, skips the field or shortens the text, and says so in Notes. Each such note starts with a fixed code, so a flow can check for it, for example with contains FieldSkipped:

The action only fails if there is no file or the file cannot be read, for example an old .doc or .xls file, a damaged file or a file without any text.

Values per invoice line

A field with Applies To Line is read for every invoice line. Its values are in Invoice Items: each line has its own Additional Field Values (by field name) and Additional Field Details (value, certainty, page, found text and whether it needs review). At the top level, Additional Field Values and Additional Field Details only contain the fields with Document; Additional Field N Value stays empty for a line field, so the numbering still follows your list.

Field Type, Check Type and Review Level work for each line as for the document. A note about a line starts with its number, for example Line 2: The required field 'Delivery note' was not found on the document., and a missing required value is listed in Missing Required Fields as Line 2: Delivery note. If no invoice lines are found, Notes says Line fields were requested, but no line items were found.

Example: the delivery note number of each line

Sample invoice of Muster Bau GmbH with a delivery note number below each item

Download the sample invoice with lines (PDF). It has the project number P-204711 at the top right and, below each item, the delivery note the item came with: items 4711 and 4712 with L202611041, item 4790 with L202611052.

The project number is the same for the whole invoice, so it keeps Applies To Document. For the delivery note we add a second field with Applies To Line:

Parameters: Project number with Applies To Document, Delivery note with Applies To Line

Say exactly which part of the text you want. Without only the number ... without that word, the AI may return Lieferschein L202611041 instead of L202611041.

After the run, the document field is at the top level, as in Step 5:

Outputs at the top level: Project number in Additional Field Values, Additional Field 1 Value and Additional Field Details

Additional Field 2 Value stays empty, because Delivery note is a line field. Its values are in Invoice Items, one per line. The first line has the delivery note L202611041, read from the text Lieferschein L202611041:

Outputs of the first invoice line: article number, discount and the line field Delivery note L202611041

Use the line values in your flow

Invoice Items is a list. Add the control Apply to each, select Invoice Items of the action, and use the values of the current line inside it, for example in a Compose with this expression:

items('Apply_to_each')?['additionalFieldValues']?['Delivery note']

The text in the last brackets is your Field Name, written exactly the same. If your loop has another name, use that name with _ instead of spaces. In our test flow, the Compose writes Item @{items('Apply_to_each')?['articleNumber']} came with delivery note @{items('Apply_to_each')?['additionalFieldValues']?['Delivery note']}. For the first of the three lines it returns Item 4711 came with delivery note L202611041:

Apply to each over the invoice lines: the Compose of the first line returns Item 4711 came with delivery note L202611041

Discounts and article numbers in the invoice lines

Each invoice line also returns Article Number (the item number of the seller), Gross Unit Price (the unit price before the line discount), Discount Percent and Discount Amount (the discount of the whole line), each only if it is printed. Unit Price is the net unit price after the discount.

If the net unit price is not printed, or quantity × unit price differs from Line Net Amount by more than 0.02, the action calculates it as line net amount / quantity, rounded to 4 decimals, and Notes says for example Line 1: unit price derived from line net amount.

Many invoices print only the price before the discount, for example Einzelpreis 33,00 | Rabatt 40 % | Betrag 594,00. If this printed price, the quantity and Discount Percent give the line net amount, the printed price is returned as Gross Unit Price, and Notes says for example Line 1: gross unit price taken from the printed unit price. Example: 30 pieces at 33.00 with 40 % discount and a line net amount of 594.00 give Unit Price 19.8, Gross Unit Price 33 and Discount Percent 40. Discount Amount is only filled if the invoice prints it, here it stays empty. This is the first line of the sample invoice with lines above.

If no country is printed for the seller or the buyer, but the postcode has 5 digits and the VAT ID of the same party starts with DE, the country is set to DE, and Notes says Seller country DE derived from VAT ID and postcode. (or Buyer country ...).

The full response

Response of the run above (shortened, standard fields partly left out):

{
  "invoiceNumber": "RE-2026-0815",
  "invoiceDate": "2026-11-12",
  "sellerName": "Muster Bau GmbH",
  "sellerVatId": "DE129273398",
  "buyerName": "Beispiel Handel AG",
  "buyerOrderNumber": "PO-99812",
  "iban": "DE02 1203 0000 0000 2020 51",
  "totalNetAmount": 1000.0,
  "totalVatAmount": 190.0,
  "totalGrossAmount": 1190.0,
  "isReadyForEInvoice": true,
  "needsReview": false,
  "additionalFieldValues": {
    "Project number": "P-204711",
    "Cost center": "KST-4711",
    "Supplier IBAN": "DE02120300000000202051"
  },
  "additionalField1Value": "P-204711",
  "additionalField2Value": "KST-4711",
  "additionalField3Value": "DE02120300000000202051",
  "additionalFieldDetails": [
    {
      "fieldName": "Project number",
      "value": "P-204711",
      "certainty": 95,
      "page": 1,
      "foundText": "Projekt: P-204711",
      "needsReview": false
    },
    {
      "fieldName": "Cost center",
      "value": "KST-4711",
      "certainty": 95,
      "page": 1,
      "foundText": "Kostenstelle: KST-4711",
      "needsReview": false
    },
    {
      "fieldName": "Supplier IBAN",
      "value": "DE02120300000000202051",
      "certainty": 95,
      "page": 1,
      "foundText": "IBAN DE02 1203 0000 0000 2020 51",
      "needsReview": false
    }
  ]
}

The standard field IBAN is returned as printed, the own field with the check IBAN without spaces. If a required field is missing, Needs Review is true, the field is listed in Missing Required Fields and Notes says for example The required field 'Project number' was not found on the document.

Checks

When is a value marked for review?

A field gets Needs Review = true if it is required and missing, if its check fails, or if the AI certainty is below the Review Level: Rarely = below 60, Normal = below 80, Often = below 90. With Validate Standard Fields the IBAN, the VAT IDs, the totals (net + VAT = gross) and the sum of the invoice lines are checked as well.

Tips

Parameters

PropertyNameTypeDescription
invoiceFileInvoice File requiredfile (base64)The invoice as PDF, JPEG or PNG (scan or photo), as XML e-invoice, or as DOCX, XLSX or text file (e.g. TXT, CSV).
additionalInstructionsAdditional Instructions advancedstringOptional description of the document or hints for the AI, e.g. 'amounts are in USD'. Max 2000 characters.
replaceDefaultInstructionsReplace Default Instructions advancedbooleanIf true, 'Additional Instructions' replaces the default document type (invoice). Rules and output format stay the same.
default: false
additionalFieldsAdditional Field advancedarray of DtoAdditionalFieldUp to 10 own fields to extract in addition to the standard invoice fields.
readHeaderAndFooterInDetailRead Header and Footer in Detail advancedbooleanIf true, the top and bottom of page 1 are also sent zoomed in, so small print like bank details is read better.
default: true
validateStandardFieldsValidate Standard Fields advancedbooleanIf true, IBAN, VAT IDs and totals are checked; problems set 'Needs Review'.
default: true
reviewLevelReview Level advancedstring (dropdown)How often values are marked for review: Rarely, Normal or Often.
default: "Normal"; dynamic dropdown
dataSourceModeData Source Mode advancedstring (dropdown)Auto: embedded e-invoice first, AI for the rest. Always AI. XML Only: no AI.
default: "Auto"; dynamic dropdown

Returns

PropertyNameTypeDescription
invoiceNumberInvoice Number stringRecognized invoice number
invoiceDateInvoice Date stringRecognized invoice date (format: yyyy-MM-dd)
currencyCodeCurrency stringRecognized currency code (e.g., EUR, USD)
sellerNameSeller Name stringRecognized seller company or person name
sellerStreetSeller Street stringRecognized seller street address
sellerPostcodeSeller Postcode stringRecognized seller postal code
sellerCitySeller City stringRecognized seller city or locality
sellerCountrySeller Country stringRecognized seller country (ISO code, e.g., DE)
sellerVatIdSeller VAT ID stringRecognized seller VAT ID
buyerNameBuyer Name stringRecognized buyer company or person name
buyerStreetBuyer Street stringRecognized buyer street address
buyerPostcodeBuyer Postcode stringRecognized buyer postal code
buyerCityBuyer City stringRecognized buyer city or locality
buyerCountryBuyer Country stringRecognized buyer country (ISO code, e.g., DE)
ibanIBAN stringRecognized bank account IBAN for payment
paymentDueDatePayment Due Date stringRecognized payment due date (format: yyyy-MM-dd)
totalNetAmountTotal Net Amount numberRecognized total net amount (without VAT)
totalVatAmountTotal VAT Amount numberRecognized total VAT amount
totalGrossAmountTotal Gross Amount numberRecognized total gross amount (including VAT)
invoiceLinesInvoice Items array of DtoRecognizedInvoiceLineV2Recognized line items of the document (invoice lines, or positions of a delivery note, order or quote request)
needsReviewNeeds Review booleanTrue if a check failed (IBAN, VAT ID, totals, own field checks), a required own field is missing, or the AI was not sure enough
checkStatusCheck Status stringOK if no check found anything, Check if a value should be looked at, Error if a hard check failed (totals, IBAN, a required field or no XML)
deliveryDateDelivery Date advancedstringRecognized delivery date (format: yyyy-MM-dd)
buyerReferenceBuyer Reference advancedstringRecognized buyer reference or Leitweg-ID (BT-10)
buyerOrderNumberOrder Number advancedstringRecognized purchase order number of the buyer (BT-13)
sellerEmailSeller Email advancedstringRecognized seller email address
buyerVatIdBuyer VAT ID advancedstringRecognized buyer VAT ID
bicBIC advancedstringRecognized bank identifier code (BIC)
paymentRecipientPayment Recipient advancedstringRecognized name of the payment recipient
paymentTermPayment Term advancedstringRecognized payment term
isReadyForEInvoiceReady for E-Invoice advancedbooleanWhether the recognized data contains all fields required to create a valid e-invoice (EN 16931). If false, check 'Missing Required Fields'
missingRequiredFieldsMissing Required Fields advancedarray of stringRequired e-invoice fields and required own fields that could not be recognized, for example 'Invoice Number (BT-1)'
notesNotes advancedarray of stringNotes about the recognition, for example skipped pages or uncertain values
checkHintsCheck Hints advancedarray of DtoCheckHintOne entry per finding with a fixed code, the sentence from Notes and the field it concerns; empty if the status is OK
dataSourceData Source advancedstringWhere the values come from: AI (read by the AI), XML (from the e-invoice) or XML and AI (missing fields by AI); empty if nothing was read
additionalFieldValuesAdditional Field Values advancedobjectValues of your own fields with 'Applies To' Document, by field name (line fields are in 'Invoice Items')
additionalField1ValueAdditional Field 1 Value advancedstringValue of own field 1 in the order of 'Additional Field' (empty for a field with 'Applies To' Line)
additionalField2ValueAdditional Field 2 Value advancedstringValue of own field 2 in the order of 'Additional Field' (empty for a field with 'Applies To' Line)
additionalField3ValueAdditional Field 3 Value advancedstringValue of own field 3 in the order of 'Additional Field' (empty for a field with 'Applies To' Line)
additionalField4ValueAdditional Field 4 Value advancedstringValue of own field 4 in the order of 'Additional Field' (empty for a field with 'Applies To' Line)
additionalField5ValueAdditional Field 5 Value advancedstringValue of own field 5 in the order of 'Additional Field' (empty for a field with 'Applies To' Line)
additionalField6ValueAdditional Field 6 Value advancedstringValue of own field 6 in the order of 'Additional Field' (empty for a field with 'Applies To' Line)
additionalField7ValueAdditional Field 7 Value advancedstringValue of own field 7 in the order of 'Additional Field' (empty for a field with 'Applies To' Line)
additionalField8ValueAdditional Field 8 Value advancedstringValue of own field 8 in the order of 'Additional Field' (empty for a field with 'Applies To' Line)
additionalField9ValueAdditional Field 9 Value advancedstringValue of own field 9 in the order of 'Additional Field' (empty for a field with 'Applies To' Line)
additionalField10ValueAdditional Field 10 Value advancedstringValue of own field 10 in the order of 'Additional Field' (empty for a field with 'Applies To' Line)
additionalFieldDetailsAdditional Field Details advancedarray of DtoAdditionalFieldDetailDetails for each own field with 'Applies To' Document: value, certainty, page, found text and whether it needs review

Type DtoAdditionalField

PropertyNameTypeDescription
fieldNameField Name stringName of the field, e.g. 'Project number'. Used as key in 'Additional Field Values'.
fieldDescriptionField Description stringWhere to find the value on the document, e.g. 'top right, after Project:'.
fieldTypeField Type string (dropdown)Kind of value: Text, Number, Date or Amount.
default: "Text"; dynamic dropdown
requiredRequired advancedbooleanIf true, a missing value is listed in 'Missing Required Fields' and marked for review.
default: false
checkTypeCheck Type advancedstring (dropdown)Optional check: None, IBAN, VAT ID, Tax Number, Date, Amount or Custom Format.
default: "None"; dynamic dropdown
customFormatCustom Format advancedstringPattern for 'Custom Format': # = digit, A = letter, e.g. P-######.
appliesToApplies To advancedstring (dropdown)Document = one value per document, Line = one value per line item or table row.
default: "Document"; dynamic dropdown

Type DtoRecognizedInvoiceLineV2

PropertyNameTypeDescription
descriptionDescription stringRecognized description of the invoiced item or service
quantityQuantity numberRecognized quantity of the item
unitCodeUnit Code stringRecognized measurement unit (ISO code, e.g., C62 for piece)
unitPriceUnit Price numberRecognized net unit price after line discount, without tax. If it is missing or does not match the line net amount, it is derived from line net amount and quantity (see Notes)
vatPercentVAT Percent numberRecognized VAT rate for the item (e.g., 19 for 19%)
lineNetAmountLine Net Amount numberRecognized net amount of the line
articleNumberArticle Number stringRecognized article number of the seller (BT-155)
grossUnitPriceGross Unit Price numberRecognized unit price before line discount, without tax (BT-148)
discountPercentDiscount Percent numberRecognized line discount in percent (e.g., 40 for 40%)
discountAmountDiscount Amount numberRecognized discount amount of the whole line, without tax (BT-136)
additionalFieldValuesAdditional Field Values advancedobjectValues of your own fields with 'Applies To' Line for this line, by field name
additionalFieldDetailsAdditional Field Details advancedarray of DtoAdditionalFieldDetailDetails for each own field with 'Applies To' Line for this line: value, certainty, page, found text and whether it needs review

Type DtoAdditionalFieldDetail

PropertyNameTypeDescription
fieldNameField Name stringName of the own field
valueValue stringRecognized value (dates as yyyy-MM-dd, amounts with a decimal point)
certaintyCertainty integer (int32)How sure the AI is, from 0 to 100
needsReviewNeeds Review booleanTrue if the check failed, a required value is missing, or the certainty is below the review level
pagePage advancedinteger (int32)Page where the value was found, starting at 1
foundTextFound Text advancedstringText on the document the value was read from

Type DtoCheckHint

PropertyNameTypeDescription
codeHint Code stringFixed code of the finding, for example TotalsMismatch, IbanInvalid or PagesSkipped
textHint Text stringThe finding as an English sentence (the same as in Notes, except for LowCertainty)
fieldHint Field stringThe field the finding concerns, for example IBAN or Line 2: Cost Center; empty if it concerns the whole document

Example request

{
  "invoiceFile": "<base64-encoded file content>"
}

Example generated from the connector definition.