/
FlowAP's XML Mapping Template: A Detailed Guide

FlowAP's XML Mapping Template: A Detailed Guide

FlowAP Template

The FlowAP template defines the templates used for different parts of the inbound transactions to ensure clear communication between the vendor who sends the invoice (scanning service, electronic invoicing service) and the buyer who receives the invoice (NetSuite).

The FlowAP template only supports inbound invoices. These are AP posting transactions in NetSuite, the vendor bill, and vendor bill credit.

The FlowAP template is a custom record in NetSuite where you can define the name of the FlowAP template and the template contents.

The FlowAP template uses JSON as the data interchange format. JSON defines the value pairs and arrays between the XML UBL 2.1 file and NetSuite fields.

Field name

Description

Primary Information

Name

Enter a name for your FlowAP Template.

Lookup Criteria

Vendor Lookup Criteria

JSON objects that would be used as criteria for searching the Vendor for the FlowAP Document. You can enter a maximum of 15 criteria and a minimum of 1.

Item Lookup Criteria

JSON objects that would be used as criteria for searching the Item for the FlowAP Document. You can enter a maximum of 5 criteria and a minimum of 1.

Mapping Templates

Transaction Mapping

JSON object which defines the mapping for the Transaction Header and Lines.

Vendor Mapping

JSON object which defines the mapping for the new vendor creation.

Navigating to the setup

Navigate to FlowAP > FlowAP Configuration > Staria FlowAP Template

This is the list of available FlowAP templates. 3 default templates come with FlowAP upon installation.

You must not edit the Default FlowAP Templates.

Any changes made to the default template will be overridden during new version releases of FlowAP.

To use a customized version of the FlowAP template, save a copy of the Default FlowAP Template.

Apply your own lookup criteria and XML mapping to the new FlowAP Template; and assign it to the relevant Staria FlowAP Subsidiary Setup.

Assigning FlowAP Templates to the FlowAP Subsidiary setup

  1. Navigate to FlowAP > FlowAP Configuration > Staria FlowAP Subsidiary Setup.

  2. Select the subsidiary setup and click edit.

  3. Navigate to the Conversion subtab and find the FlowAP template field.

  4. Select the FlowAP Template.

  5. Click Save.

Parts of the FlowAP Template

1. Lookup Criteria

2. FlowAP Template Mapping

The template mapping defines the destination NetSuite fields vs the source XML element values used when creating records/transactions in Netsuite. Templates are created for:

  • 2.1 AP Transaction (Vendor Bill / Vendor Credit)

  • 2.2 Vendor

  • 2.3 Vendor Contact

FlowAP Template Notation

The FlowAP template is based on JSON syntax. The mapping templates are written inside curly braces.

 

General Mapping Notation

This mapping notation is used for the majority of the transaction fields. This maps one (1) NetSuite field to (1) XML element.

Example:

{ "nsfieldid1": { "xpath": ["/cac:parentxmlelement/cbc:childxmlelement1"] }, "nsfieldid2": { "xpath": ["/cac:parentxmlelement/cbc:childxmlelement2"] } }

Each field mapping contains the name/value pairs. The name/value pairs consist of:

  • NetSuite field ID - The field ID of the target field of the NetSuite record or transaction

  • XML element path - The XML element together with its parent element. The parent element is not needed if the element is a direct child of the <Invoice> element.

 

Multiple Source Mapping Notation

The general field mapping notation can be modified to map one (1) Netsuite field to multiple XML elements. If the first mapped XML element is empty, the succeeding mapping will be used.

Example:

"taxpercent": { "xpath" : [ "./cac:Item/cac:ClassifiedTaxCategory/cbc:Percent", "/cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory/cbc:Percent"] },

In this example, the taxpercent field is mapped to the line-level tax percent and the transaction header-level tax percent.

If the line level tax percent is empty in the XML, the transaction header level tax percent will be used instead.

 

Complex-type Mapping Notation

Complex-type JSON objects define the mapping for a NetSuite sublist or child record linked to the transaction.

The following complex-type JSON objects are included in the default template:

  1. Transaction Expense/Item Sublist

  2. NetSuite Electronic Bank Payment Vendor Entity Bank Details

  3. Allowance Charge

Example:

{ "nssublistname": { "listpath": ["/cac:parentxmlelement", "fields" : [ { "nsfieldid1": { "xpath": ["/cac:parentxmlelement/cbc:childxmlelement1"] }, "nsfieldid2": { "xpath": ["/cac:parentxmlelement/cbc:childxmlelement2"] }, } ] } }

For all fields in the sublist:

  • If the xpath starts with a period (.) - this means that the absolute path to get the XML value is Invoice/<listpath>/<xpath>

  • Otherwise, the absolute path starts directly from the Invoice element similar to the body fields: Invoice/<XPath>

Example:

For taxpercent, there are 2 xpaths which means that there’s a hierarchy in retrieving the value for taxpercent

  1. ./cac:Item/cac:ClassifiedTaxCategory/cbc:Percent - since this xpath starts with a period, the actual path for this is Invoice/cac:InvoiceLine/cac:Item/cac:ClassifiedTaxCategory/cbc:Percent

  2. If number 1 returns a null value (null = missing element or no value at all. 0 is considered a valid value), /cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory/cbc:Percent is used. Since this does not start with a period, the actual path for this is Invoice/cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory/cbc:Percent

 

Fields with Special Validations or Automations

Field

Validation / Automation Details

Field

Validation / Automation Details

Expense Line : Memo field

For unidentified items posted as expense lines

 

NetSuite expense lines created when conversion is unable to identify a NetSuite item for the invoice line.

The memo field of the expense line will have the value:

<taxpercent> | <vendorcode> - <itemname>

Related article: How to customize the memo field value of expense lines created by FlowAP conversion for unidentified items

Expense Line : Memo

For expense line posted when POST SINGLE BILL LINE = T

  • If Vendor Preference > [STA] POST SINGLE BILL LINE: USE FIRST XML MEMO = T and firstmemo_value is not empty the format will be

    • <taxpercent_total> | <firstmemo>

  • Else

    • <taxpercent_total> | “Transaction Total”

      • Transaction Total is fixed/static text. This is to indicate that this single line is the transaction total from the XML.

Currency

The XML currency is always used. "currency": {"xpath" : ["/cbc:DocumentCurrencyCode"]},

  1. If the XML currency is not configured in NetSuite (List>Accounting>Currencies) the conversion will result to an error.

  2. If the XML currency is configured in NetSuite, but not found in the vendor’s available currencies, it will be added to the vendor record and conversion will be successful in using the XML currency.
    How Transaction Currency is determined by FlowAP Conversion : A Detailed Guide

Invoice Item Line : Quantity

The quantity is defaulted to 1 if there is no indicated quantity in the XML for an item line.

Vendor : VAT

"vendorvat": {"xpath": ["/cac:AccountingSupplierParty/cac:Party/cac:PartyIdentification/cbc:ID[@schemeID=\"VAT\"]"]},

Subsidiary : VAT

"subsidiaryvat": {"xpath": ["/cac:AccountingCustomerParty/cac:Party/cac:PartyIdentification/cbc:ID[@schemeID=\"VAT\"]"]},

All fields

After parsing the mapped fields and no value is found in the XML, the created JSON data from the XML will set the value as “STA_EMPTY“.

Location

A hierarchy is implemented for determining the location to be set.

Where does FlowAP get the Transactions' Location Value?

Billing Address : Country

If the XML’s billing country is empty, the vendor record’s billing country will be used.

Reference Number

Unique Transaction reference numbers are validated for each transaction type (vendor bill and vendor bill credit). The conversion will fail for duplicate transaction reference numbers.

Related FlowAP Subsidiary Setup Options

The following setup options influence or override the behavior of the mapped elements during conversion.

Use Case

Setup Options

Related Articles

Use Case

Setup Options

Related Articles

Allow transaction creation to proceed even if the conversion was unable to find a matching NetSuite item for the vendor bill lines.

The conversion will post unidentified items as expense lines.

FlowAP Subsidiary Setup > CREATE UNIDENTIFIED ITEMS AS EXPENSE

How does FlowAP Post unidentified items?

Use NetSuite expense items instead of expense lines

FlowAP Subsidiary Setup > USE EXPENSE ITEMS INSTEAD OF ACCOUNTS FOR EXPENSE LINES

Expense Item/Account Lookup Hierarchy

Ignore XML line level data and allow NetSuite to copy the line level information from the related purchase order in NetSuite.

The total payable amount of the bill will always be equal to the XML.

The user responsible for the bill is expected to review the line details of the bill and make the necessary data entry to correct it for the total payable amount.

FlowAP Subsidiary Setup > INHERIT PO LINES

FlowAP Subsidiary Setup > INHERIT PO LINES: DEFAULT TO 0 QUANTITY AND AMOUNT

Inherit Purchase Order Lines with Variances

Ignore the XML line level data and save a single transaction line in NetSuite transaction.

 

FlowAP Subsidiary Setup > POST SINGLE BILL LINE: USE PAYABLE AMOUNT (NO TAX)

[STA] POST SINGLE BILL LINE preference guide

Do not allow a well-formed XML to create a stand-alone bill (Direct bill) if the PO Reference is empty.

Staria FlowAP Subsidiary Setup > WHEN BILL NOT FOUND

Staria FlowAP Subsidiary Setup | Flowsetup whenbillnotfound

Do not allow a well-formed XML to create a stand-alone bill credit (Direct Credit) if the Bill Reference is empty.

Staria FlowAP Subsidiary Setup > WHEN PO# NOT FOUND

Staria FlowAP Subsidiary Setup | Flowsetup whenPOnotfound

Do not allow stand alone transactions for a specific vendor.

Configure vendor preferences in the vendor record.

  1. Vendor Preference: [STA] No Direct Bill

  2. Vendor Preference: [STA] No Direct Credit

Configure the Vendor-specific preferences saved search in the FlowAP Subsidiary Setup > VENDOR-SPECIFIC PREFERENCES

Vendor Record

Vendor related configuration for FlowAP conversion: A Detailed Guide | Vendor Specific Preferences

 

Define tax codes for each tax rate/percent parsed from the XML during conversion.

FlowAP Subsidiary Setup > TAX CODE TABLE

Hierarchy Used by FlowAP Conversion When Selecting Tax Codes on Vendor Bill Lines | Tax Code Hierarchy for Bill Items

Limitations

Related content