Conditional Table Mapping
Conditional mapping (also called Alternative Mapping) allows you to route documents to different folders based on field values. This page explains how to configure and use alternative mappings.
What is Conditional Mapping?
Conditional mapping routes records to different SharePoint folders based on conditions:
| Condition | Destination |
|---|---|
| Sales Order Type = Quote | /Quotes/ |
| Sales Order Type = Order | /Orders/ |
| Customer Country = US | /US Customers/ |
| Customer Country = DE | /EU Customers/ |
When to Use Conditional Mapping
Use Cases
- Document types: Quotes vs Orders vs Invoices to different folders
- Geographic separation: Different regions to different folders or sites
- Business unit separation: Different departments to different locations
- Status-based routing: Active vs Archived records
- Product lines: Different categories to different folders
Example Scenarios
| Table | Condition | Alternative Folder |
|---|---|---|
| Sales Header | Document Type = Quote | Quotes |
| Sales Header | Document Type = Order | Orders |
| Customer | Market Segment = Enterprise | Enterprise Customers |
| Customer | Market Segment = SMB | SMB Customers |
Configuring Alternative Mapping
Accessing Alternative Mapping
- Open the Table Mapping Card for the relevant table
- Click the Alternative Folders action
- The Alternative Mapping page opens filtered to that table
Note: The Alternative Mapping page has
UsageCategory = None, so it cannot be found via the Business Central search. It is accessed through the Table Mapping Card.
Alternative Mapping Fields
| Field | Description | Example | |
|---|---|---|---|
| Table No. | The BC table | 36 (Sales Header) | |
| Test Field No. | Field to test for matching | Document Type | |
| Match Value | Value to match (supports BC filter expressions) | Quote or `Order |
Invoice` |
| Folder Name | Alternative folder name | Quotes | |
| Site Name (Optional) | Alternative site (no leading /). Hidden by default -- personalize it onto the page to use it |
sites/sales, teams/sales, or sales |
|
| Base Folder | Alternative base folder. Hidden by default -- personalize it onto the page. Required whenever the alternative sets a Site Name (otherwise folder resolution fails with a "missing a base folder" error, unless the table mapping itself has a Document Library override) | Documents | |
| Caption Field (Name) | Alternative caption field (optional) | - | |
| Caption Specification Field (Number) | Alternative specification field (optional) | - | |
| Priority | Evaluation order (highest number wins) | 10 | |
| Parent Table No. | Alternative parent table (optional) | - | |
| Parent Ref. Field No. | Alternative parent link field (optional) | - | |
| Parent Ref. Field No. (2) | Second parent link field (optional, hidden by default) | - | |
| Parent Ref. Field No. (3) | Third parent link field (optional, hidden by default) | - |
Configuration Steps
- Open the Table Mapping Card for the table and click the Alternative Folders action. The page opens already linked to that table -- there is no Table No. field to fill in
- Click New
- Choose the Test Field (the field to evaluate)
- Enter the Match Value (what to match)
- Enter the Folder Name (where to route)
- Optionally set Site Name and Base Folder overrides. Both fields are hidden by default, so personalize them onto the page first; the Base Folder is required whenever a Site Name is set
- Set Priority for evaluation order
- Save
Example Configurations
Sales Document Types
Route different sales document types to different folders:
| Table No. | Test Field | Match Value | Folder Name | Priority |
|---|---|---|---|---|
| 36 | Document Type | Quote | Quotes | 10 |
| 36 | Document Type | Order | Orders | 20 |
| 36 | Document Type | Invoice | Invoices | 30 |
| 36 | Document Type | Credit Memo | Credit Memos | 40 |
| 36 | Document Type | Blanket Order | Blanket Orders | 50 |
Customer Segmentation
Route customers by market segment:
| Table No. | Test Field | Match Value | Folder Name | Priority |
|---|---|---|---|---|
| 18 | Market Segment | Enterprise | Enterprise | 10 |
| 18 | Market Segment | SMB | SMB | 20 |
| 18 | Market Segment | Consumer | Consumer | 30 |
Geographic Routing
Route to different SharePoint sites by region:
| Table No. | Test Field | Match Value | Site Name | Folder Name | Priority |
|---|---|---|---|---|---|
| 18 | Country | US | sites/us | /Customers | 10 |
| 18 | Country | CA | sites/us | /Customers | 20 |
| 18 | Country | DE | sites/eu | /Customers | 30 |
| 18 | Country | FR | sites/eu | /Customers | 40 |
Priority and Evaluation
How Priority Works
- All matching conditions are evaluated
- The matching condition with the highest priority number wins
- If no conditions match, the default table mapping is used
Important: Higher priority values take precedence. A condition with Priority 50 overrides one with Priority 10 if both match.
Priority Best Practices
| Priority Range | Use For |
|---|---|
| 100+ | Highest priority overrides |
| 50-100 | Primary conditions |
| 10-50 | Secondary conditions |
| 1-10 | Lowest priority fallbacks |
Evaluation Example
For a record matching both Priority 10 and Priority 50:
- Check all conditions against the record
- Priority 10: Condition A → Match
- Priority 50: Condition B → Match
- Priority 50 wins (highest number)
- Route to Condition B's folder
Advanced Configurations
Multiple Conditions
You can have multiple alternative mappings for different scenarios on the same table. Each is evaluated in priority order.
Combining with Site Override
Route different conditions to different SharePoint sites:
Condition A → Site 1, Folder X
Condition B → Site 2, Folder Y
Default → Default Site, Default Folder
Alternative Caption Field
You can also override the caption field used for folder naming:
| Condition | Alternative Caption | Result |
|---|---|---|
| Type = Internal | Internal Code | Uses internal code for folder name |
| Type = External | External Name | Uses external name for folder name |
Indicator on Table Mapping
When a table has alternative mappings:
- Open SharePoint Table Mapping
- Look for the "Alternative Mapping Exists" indicator
- The indicator is display-only (not clickable) -- to view or manage alternative mappings, use the Alternative Folders action on the Table Mapping card or list
Testing Alternative Mappings
Verification Steps
- Create a record matching a condition
- Open the record in BC
- Check the SharePoint FactBox
- Verify the folder path matches expected alternative
Debugging
If routing isn't as expected:
- Check the condition field value exactly matches
- Verify priority order
- Confirm no higher-priority condition matches first
- Check that alternative mapping is saved and active
Common Patterns
Document Lifecycle
| Stage | Condition | Folder |
|---|---|---|
| Draft | Status = Open | Drafts |
| Submitted | Status = Released | Active |
| Archived | Status = Archived | Archive |
Year-Based Routing
For fiscal year organization, use a date range filter as the Match Value on a date field:
| Test Field | Match Value | Folder |
|---|---|---|
| Posting Date | 01-01-24..31-12-24 |
2024 |
| Posting Date | 01-01-25..31-12-25 |
2025 |
The matching engine applies the Match Value as a typed filter, so date values and date ranges work natively on Date and DateTime fields -- no custom development is needed.
Department Routing
| Condition | Folder |
|---|---|
| Salesperson = Team A | Team A |
| Salesperson = Team B | Team B |
Match Value Expressions
The Match Value field supports Business Central filter expressions, not just exact matches. This uses the same syntax as BC's SetFilter function.
Supported Filter Syntax
| Expression | Meaning | Example |
|---|---|---|
Value |
Exact match | Quote |
Value1&#|;Value2 |
OR (either value) | Quote&#|;Order |
text |
Contains | US |
text* |
Starts with | US* |
*text |
Ends with | *Ltd |
10..50 |
Range | 10..50 |
<>Value |
Not equal | <>Quote |
Filters are applied using the data type of the Test Field (text, integer, decimal, date, or datetime), so numeric and date/datetime values and ranges (e.g., 01-01-24..31-12-24) work natively.
Note: The match value is case sensitive, as noted in the tooltip.
Limitations
Current Limitations
| Limitation | Workaround |
|---|---|
| One field per condition | Create multiple conditions |
| Static values only | Cannot use calculated values |
| Multiple field combinations not built-in | Create separate conditions per field |
Complex Scenarios
For scenarios requiring:
- Dynamically calculated date ranges (e.g., a "current year" filter that rolls over automatically)
- Multiple field combinations
- Complex logic
Consider custom development. Contact the publisher or a partner for assistance.