Coupa AP: Data templates

You can configure the Coupa target system service to map fields from Tungsten AP Essentials to Coupa.

This topic refers to the Coupa AP integration, which is the most current version of the Coupa integration and uses the latest version of the Coupa API.

By default, Tungsten AP Essentials can map fields to these Coupa fields. If your solution has custom fields, however, you can use data templates to map fields from Tungsten AP Essentials to Coupa.

You can specify data templates for header and line-item fields in the Custom field mapping and Custom line-item field mapping settings, remit-to codes in the Remit-to code template settings, and requesters in the User mapping settings. See target system settings.

You specify custom field values using the format, CoupaCustomField="value", where CoupaCustomField is the target field Coupa, and value is any possible value defined later in this topic. Use a semicolon to separate multiple field specifications. For your convenience, you can click TEST, which among other things, makes sure the fields you specify exist in Coupa.

Three types of custom fields are supported in Coupa: text, number and date. When mapping to custom fields in Coupa, make sure the field type in Tungsten AP Essentials matches the correct type in Coupa. For example, if the Tungsten AP Essentials field has the type, Amount, the corresponding Coupa field must have the type, number. If the field types do not match, the custom field the data will not be transferred, however, the invoice will still be sent to Coupa without causing an error.

You specify the data templates using plain-text constants and variables enclosed in percent marks.

  • Constants - fixed values that you specify as text.
  • Variables - dynamic values that are determined by document data or system data. Variables are enclosed in percent characters (%).

To specify a variable for a document field, enclose the type name of the field in percent characters (%).

A variable can also be preceded by:

  • # - to indicate that it is a system variable.
  • @ - to indicate that it is a history variable.

Examples

A value in a data template can consist of multiple plain-text constants, field variables, system variables, and history variables. For example, suppose you type the following in the Custom field mapping setting:

CoupaCustomField="Invoice %InvoiceNumber% is due by %InvoiceDueDate%"

In this example, the value of the Coupa field could be, for example, "Invoice 0000558 is due by 2023-12-31".

Consider the following example which utilizes history variables and system variables:

CUSTOMFIELDAPPROVER="%@user9%";CUSTOMFIELDAPPROVALDATE="%@date9%";CUSTOMFIELDLINK="%#Permalink%"

In this example:

  • CUSTOMFIELDAPPROVER is set to a history variable that refers to the name of the user who verified the invoice.

  • CUSTOMFIELDAPPROVALDATE is set to a history variable that refers to the date and time when the invoice was verified.

  • CUSTOMFIELDLINK is set a system variable that refers to the permanent image link (URL) in Tungsten AP Essentials storage.

Variables

The Coupa AP integration supports system variables and history variables.

System variables

You can specify system variables to obtain the values of system variables in Tungsten AP Essentials.

  • #buyer.Type
  • #buyer.Name
  • #buyer.Id
  • #buyer.ExternalId
  • #buyer.Description
  • #buyer.TaxRegistrationNumber
  • #buyer.OrganizationNumber
  • #buyer.Street
  • #buyer.PostalCode
  • #buyer.City
  • #buyer.CountryName
  • #buyer.PaymentTerm
  • #buyer.PaymentMethod
  • #buyer.CurrencyCode
  • #buyer.BankAccounts
  • #DocumentTypeSystemName
  • #Permalink
  • #ProfileName
  • #Supplier
  • #Supplier.Description
  • #supplier.Type
  • #supplier.Name
  • #supplier.Id
  • #supplier.ExternalId
  • #supplier.TaxRegistrationNumber
  • #supplier.OrganizationNumber
  • #supplier.Street
  • #supplier.PostalCode
  • #supplier.City
  • #supplier.CountryName
  • #supplier.PaymentTerm
  • #supplier.PaymentMethod
  • #supplier.CurrencyCode
  • #supplier.BankAccounts

History variables

You can specify history variables to obtain the user or the date and time of a specific process. You construct a history variable using one of these formats:

  • @UserX
  • @DateX
...where User specifies that you want the user associated with the process, Date specifies that you want the date the process occurred and X specifies the numerical code of the process you want to return. For example, %@Date0% returns the date a document was created. %@User0% returns the user name that created the document.

The default date format returned by the date variable is YYY-MM-ddTHH:mm:ss.FFFFFFFZ. For example: 2021-02-28T14:46:21.1265774Z.

Process status Numerical code
DocumentCreated 0
DocumentExtractionInProgress 1
DocumentExtractionSucceeded 2
DocumentPendingManualVerification 3
DocumentPendingCorrection 4
DocumentCorrectionFlowStarting 5
DocumentCorrectionFlowInProgress 6
DocumentCorrectionFlowDone 7
DocumentRejectedDuringVerification 8
DocumentManuallyVerified 9
DocumentPendingRegistration 10
DocumentRegistrationInProgress 11
DocumentRegistrationSucceeded 12
DocumentRegistrationFailed 13
DocumentPendingApproval 14
DocumentApprovalInProgress 15
DocumentApproved 16
DocumentApprovalSucceeded 17
DocumentApprovalRejected 18
DocumentRequestForInformation 19
DocumentPendingAllocation 20
DocumentPendingPost 21
DocumentPostInProgress 22
DocumentPostSucceeded 23
DocumentPostFailed 24
DocumentAssignedToUser 25
DocumentApprovalStarting 26
DocumentPendingExport 27
DocumentExportPostponed 28
DocumentExportInProgress 29
DocumentExportFailed 30
DocumentExportSucceeded 31
DocumentSentToStorage 32
DocumentFailed 33
DocumentDeleted 34
DocumentCommentAdded 35
LineItemExtractionUsed 36
DocumentRequestForInformationDuringVerification 37
DocumentPendingBatchRegistration 38
DocumentPendingBatchPost 39
DocumentValidationFailed 40
DocumentCodingLinesUpdated 41

Custom date formats

The default date format returned by the date variable is YYY-MM-ddTHH:mm:ss.FFFFFFFZ. For example: 2021-02-28T14:46:21.1265774Z.

You can control the format of the date variable using standard date and time formats as well as custom formats. You specify the format of your choice by enclosing it in braces after the date variable, like this:

%@date0{yyyy-MM-dd}%

The date variable above would return for example, 2021-02-28.

Additional parameters for history variables

If a history variable has multiple records associated with it, you can append history variables with additional parameters to specify whether you want the first record, last record, or all records. For example, if a document is approved by multiple users, the history variable returns the last approver by default. However, by specifying an additional parameter, you can get the first approver instead. These parameters are available:

  • First — Returns the first record in the selected history.

  • Last — Returns the last record in the selected history. This parameter is used by default if no parameter is specified.

  • All — Returns all of the records in the selected history as a semicolon-separated text sting. When using this parameter, not all target systems accept the default date format, so make sure you know what format your target system expects.

To use a parameter, append the history variable with a dot followed by the parameter. For example, to obtain the first approver:

%@User16.First%

When using additional parameters in combination with custom date history variables, specify the parameter first:

%@Date9.First{yyyy-MM-dd}%