Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,12 @@
** xref:create-third-party.adoc[Creating Third-Party Connections]
** xref:modify-third-party-settings.adoc[Modifying Third-Party Connection Settings]
** xref:delete-third-party.adoc[Deleting Third-Party Connections]
* xref:maps-overview.adoc[Creating and AddingTranslation Maps]
* xref:maps-overview.adoc[Creating and Adding Translation Maps]
** xref:partner-manager-maps.adoc[Creating Translation Maps]
** xref:maps.adoc[Adding and Versioning Maps]
* xref:lookup-tables-overview.adoc[Configuring and Managing Lookup Tables]
** xref:lookup-tables-create.adoc[Creating Lookup Tables]
** xref:lookup-tables-dataweave.adoc[Using Lookup Tables in DataWeave]
* xref:message-flows.adoc[Configuring and Managing Message Flows]
** xref:inbound-message-flows.adoc[Inbound Message Flows]
** xref:create-inbound-message-flow.adoc[Creating Inbound Message Flows]
Expand Down
61 changes: 61 additions & 0 deletions modules/ROOT/pages/lookup-tables-create.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
= Creating Lookup Tables

Create lookup tables in Partner Manager to support value translation across systems. For an overview of lookup table types and benefits, see xref:lookup-tables-overview.adoc[].

[NOTE]
Each lookup results in an Object Store v2 call. If you anticipate processing a high volume of transactions that use lookup tables, consider an Object Store v2 premium subscription. This subscription level removes the standard 10 TPS cap, making sure your message flows remain fast and reliable during peak processing times. For more information about rate limiting, see xref:object-store::osv2-usage.adoc[].

== Create a Lookup Table

To create a lookup table:

. From the Partner Manager sidebar, select *Lookup Tables*.
. Click *New Lookup Table* and select *Composite Key Lookup* or *Cross-Reference Lookup*.
. Enter a unique name with no spaces and a maximum of 50 characters. Names can include *_* and *-* characters.
. Optionally add a description.
. Click *Next*.
. Optionally enable generic lookup so that searches can use any combination of columns to find one or more matching rows.
. Configure up to 10 columns. Give each column a unique name and use no more than 30 characters. For both table types, the *Mandatory* and *Key* options are selected by default for the first column and can't be unselected. For cross-reference lookup tables, both options are also selected by default for the second column.
. For each column, configure options as needed:
+
* *Mandatory* - Column value is required when you add or import rows.
* *Key* - Column can be used as a lookup input.
. Click *Save*.

[NOTE]
Columns can't be added or modified after the table has at least one row.

[NOTE]
If generic lookup is enabled, table limits are lower. A generic lookup table supports up to 1,000 rows and 6 columns.

== Add Rows to a Lookup Table

After creating a lookup table, you can add up to 10,000 rows.

To add a row, click *Add Row* and enter up to 200 characters for the value in each column. New rows are added to the top of the lookup table.

[NOTE]
Duplicate values aren't permitted in key columns.

For DataWeave functions and examples, see xref:lookup-tables-dataweave.adoc[].

== Import Data from a CSV File

To import data from a CSV file:

. Click *Import CSV* and select the file.
. Append the data to the existing lookup table or replace the existing lookup table.
+
If you replace the lookup table, the existing data is deleted and can't be recovered.
. Click *Import*.

== Export a Lookup Table

To export a lookup table, click *Export CSV*. The lookup table is exported and can then be downloaded as a CSV file.

== Delete a Lookup Table

To delete a lookup table:

. Click *Delete*.
. Indicate that you understand that this action can't be undone and click *Delete*.
279 changes: 279 additions & 0 deletions modules/ROOT/pages/lookup-tables-dataweave.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,279 @@
= Using Lookup Tables in DataWeave

Use DataWeave lookup utility functions to retrieve values from Partner Manager lookup tables during map execution.

To call lookup tables from DataWeave, import the lookup utilities module:

[source,dwl]
----
import * from modules::b2blookuputils
----

== Function Compatibility by Lookup Table Type

Lookup functions are type-specific and can't be used interchangeably.

[%header,cols="2,2"]
|===
|Function |Supported table type

|`b2bCompositeKeyLookup`
|Composite Key Lookup only

|`b2bCrossReferenceLookup`
|Cross-Reference Lookup only

|`b2bGenericLookup`
|Generic-enabled tables only

|`b2bGenericLookupWithFilter`
|Generic-enabled tables only
|===

[IMPORTANT]
If a function is called with an unsupported table type, the lookup call fails.

== Composite Key Lookup

Function: `b2bCompositeKeyLookup(tableName, lookupObject, failIfNoMatchFound)`

Use this function only with *Composite Key Lookup* table types.

=== Parameters

[%header,cols="1,1,1,3"]
|===
|Parameter |Type |Required |Description

|`tableName`
|String
|Yes
|Lookup table name.

|`lookupObject`
|Object
|Yes
|Key-value pairs where each key is a table column name and each value is the value to match.

|`failIfNoMatchFound`
|Boolean (default `true`)
|No
|If `false`, the function returns empty data when no match is found.
|===

=== Response

[%header,cols="1,1,3"]
|===
|Field |Type |Description

|`status`
|String
|Lookup operation status.

|`errorMessage`
|String
|Error details when the operation fails.

|`data`
|Object
|Matching row data.
|===

Example:

[source,dwl]
----
%dw 2.0
output application/json
import * from modules::b2blookuputils
---
b2bCompositeKeyLookup(
"B2B-Customer-Order-Profile",
{"PARTNER_ID": "PARTNER_001", "CUSTOMER_NAME": "ACME_RETAIL"},
true
)
----

== Cross-Reference Lookup

Function: `b2bCrossReferenceLookup(tableName, columnName, columnValue, failIfNoMatchFound)`

Use this function only with *Cross-Reference Lookup* table types.

=== Parameters

[%header,cols="1,1,1,3"]
|===
|Parameter |Type |Required |Description

|`tableName`
|String
|Yes
|Lookup table name.

|`columnName`
|String
|Yes
|Key column name.

|`columnValue`
|String
|Yes
|Value to search in the key column.

|`failIfNoMatchFound`
|Boolean (default `true`)
|No
|If `false`, the function returns empty data when no match is found.
|===

=== Response

[%header,cols="1,1,3"]
|===
|Field |Type |Description

|`status`
|String
|Lookup operation status.

|`errorMessage`
|String
|Error details when the operation fails.

|`data`
|Object
|Matching row data.
|===

Example:

[source,dwl]
----
%dw 2.0
output application/json
import * from modules::b2blookuputils
---
b2bCrossReferenceLookup("Item_Code_Mapping", "Internal_SKU", "SKU-5520", true)
----

== Generic Lookup

Function: `b2bGenericLookup(tableName, failIfNoMatchFound)`

Use this function only with tables where generic lookup is enabled.

=== Parameters

[%header,cols="1,1,1,3"]
|===
|Parameter |Type |Required |Description

|`tableName`
|String
|Yes
|Lookup table name.

|`failIfNoMatchFound`
|Boolean (default `true`)
|No
|If `false`, the function returns empty data when no match is found.
|===

=== Response

[%header,cols="1,1,3"]
|===
|Field |Type |Description

|`status`
|String
|Lookup operation status.

|`errorMessage`
|String
|Error details when the operation fails.

|`data`
|Array<Object>
|Entire table data.
|===

Example:

[source,dwl]
----
%dw 2.0
output application/json
import * from modules::b2blookuputils
---
b2bGenericLookup("Payment_Terms_Mapping", true)
----

== Generic Lookup with Filter

Function: `b2bGenericLookupWithFilter(tableName, lookupObject, failIfNoMatchFound)`

Use this function only with tables where generic lookup is enabled.

=== Parameters

[%header,cols="1,1,1,3"]
|===
|Parameter |Type |Required |Description

|`tableName`
|String
|Yes
|Lookup table name.

|`lookupObject`
|Object
|Yes
|Key-value pairs used as filters.

|`failIfNoMatchFound`
|Boolean (default `true`)
|No
|If `false`, the function returns empty data when no match is found.
|===

=== Response

[%header,cols="1,1,3"]
|===
|Field |Type |Description

|`status`
|String
|Lookup operation status.

|`errorMessage`
|String
|Error details when the operation fails.

|`data`
|Array<Object>
|One or more rows matching the provided filters.
|===

Example:

[source,dwl]
----
%dw 2.0
output application/json
import * from modules::b2blookuputils
---
b2bGenericLookupWithFilter(
"Payment_Terms_Mapping",
{"Internal_Terms_Code": "NET30", "Salesforce_Payment_Term": "Net 30"},
true
)
----

[TIP]
If a transformation requires multiple lookups from the same table, retrieve table data once with `b2bGenericLookup` and then filter locally in DataWeave.

For lookup table concepts and type selection guidance, see xref:lookup-tables-overview.adoc[].
Loading