Skip to content

Rule type Prompt Template

Guided Matching provides a number of rule types to help you improve matching success and enrich Salesforce data. With Agentforce, you can take your reconciliation process even further, both to maximize matching success and solve complex use cases.

For instance, incoming payment data may not be structured to meet your reconciliation requirements. Key data could be spilt across multiple incoming records that would need custom logic to prepare for reconciliation.

Instead of creating dedicated custom logic, you can use Salesforce AI and the Prompt Template rule type. Prompt Template rules execute Salesforce Flex prompt templates and return the text of the prompt answer. This runs from Apex directly within the Guided Matching context, allowing you to do things like compile and normalize data, summarize results, and much more.

Before you start

The Prompt Template rule type is not part of the FinDock (Core) package. You need to install a dedicated Agentforce for FinDock package to get the rule type. To be able to install the package, your org needs to have access to Agentforce capabilities.

The Prompt Template rule type is visible from the rule type selector in the Guided Matching setup if the org has Agentforce. When you open the rule type, you are prompted to install the Agentforce for FinDock package. Just click the install link and follow the normal package installation process.

Agentforce for FinDock installation

Prompt Template setup

The primary work with the Prompt Template rule type is in the Flex template building. The rule setup itself is simply a matter of selecting a template and defining where it should be applied.

SettingDescription
Prompt Template API NameThe API name of the Flex Prompt Template the rule should run.
Template InputsAdd here data sources the prompt template should use in the evaluation.

Example use case

Here's an example prompt template that we'll use in the Prompt Template rule configuration.

Example Prompt Template

For convenience, here is the same content you can copy.

You are given a raw XML transaction.
XML:{!$Input:Transaction.cpm__Raw_XML_entry__c}

Extract the IBAN and BIC from the XML.

Instructions:
Find the IBAN value in the XML.
Find the BIC value in the XML. The BIC may appear in elements such as <BIC> or <BICFI>.
Ignore XML namespaces and prefixes when identifying the elements.
Return the exact values found in the XML.
Do not modify, normalize, mask, infer, or invent values.
If the IBAN cannot be found, use null.
If the BIC cannot be found, use null.
Do not include explanations or any additional text.

Return the result in exactly this format:
Iban:IBAN_VALUE - BIC:BIC_VALUE

The corresponding rule configuration to use this template is shown below.

Example Prompt Template

When the rule is used in Guided Matching, you see the name of the rule and a summary of the prompt results, as below.

Example Prompt Template

FinDock Flex templates

All Flex prompt templates in your org are available from the template dropdown menu in the rule setup. When you install the Agentforce for FinDock package, you get out-of-the-box templates designed by FinDock to address common challenges in reconciliation.

  • FinDock: Get Payment Reference from unstructured data
    This template reads the free-text remittance and description fields from the inbound record and returns the single most likely payment, invoice, mandate or installment reference, verbatim as it appears, stripped of surrounding words.
  • FinDock: Find and clean account holder name
    This template returns the payer's name in a clean, searchable form, removing, for example, legal-form suffixes and bank-specific markers.

With both templates, if no result can be determined, the prompt returns NONE on the given field. You are free to clone the template to make your own customizations. Future updates to the FinDock templates do not impact your clone.

Prompt Template best practices

When using Agentforce, please keep in mind your AI budget. A prompt per transaction on a camt.053 file with 50,000 lines, for example, would consume 50,000 Einstein units. This is why FinDock templates come with explicit entry criteria guidance.

To avoid excessive AI costs, only execute Prompt Template rules after the standard, deterministic Guided Matching rules have not succeeded on the given field.

You should always try to first solve your matching use cases with standard Guided Matching rules. These rule types are both powerful and efficient in terms of processing overhead. Prompt Template rules are intended for genuinely unpredictable and unstructured data that is not suitable for standard rule types.