Advanced XML rule example: Specify a constant value for a field

This kind of rule can be used to specify a constant value for a field. Say, for example, that you use master data and the value provided in the XML does not match the value for the supplier in your master data. Since the master data value is used in the output, you want the value to match in the PDF images.

To create an advanced rule to insert a constant value for a field:

  1. Select the field that you want a constant value for on the Fields tab of the XML Mapper (on the right side of the window). For the purpose of this example, you would select the Identifier field.
    • Click the button to the right of the value:

      if no rule has been defined, or

      if there is already an existing rule for the field.

  2. At the top of the Advanced rules settings box, click the Select button.
  3. Click the No condition: Matches both true and false. that is added to the Conditions to work with box.
  4. Under Settings to define how the invoice field value is set, select Use value below.
  5. Enter the value that you want to show up in the field, and click Add.
  6. Select Use advanced rules.

Click Extract and review the image to check the results. If you need to modify the rule, you need to click it in the Rules applied to map this field box, click Del to delete it, make the changes needed to fix the rule, and click Add again to add the modified rule. If you need to modify a condition, the process is the same (and if a rule is based on it, the rule is also deleted if you delete the condition).

Consider if the change(s) should apply to all invoices or only those for the current XML invoice definition. Click Save XML definition to save the change for the current XML invoice definition only (that is, the current supplier). Click Save XML profile if you want the rule to apply to all XML invoices that match the XML invoice profile regardless of the XML invoice definition.

Other examples of advanced XML rules:

Correct a misspelled field name in connection with master data

Format an extracted XML value with XSL

Modify an extracted XML field value with XSL

Remove hyphens (-) from an extracted value

Select node X based on node Y (or on attribute a)

Select a specific node when more than one node matches after using a standard rule

Select node X if it exists and node Y if it does not

Summarize data from line items as a note in summary invoices

Translate an XML value to one that Kofax ReadSoft Invoices understands