Resolve Lookup Field
Resolve lookup fields by finding MData records based on field name and value, returning the record ID
Resolve Lookup Field
Resolve lookup fields by finding MData records in a specified Object where a field matches a given value. Returns the UUID of the matching record, which is useful for converting string values (like names) into record IDs for data import and workflow processing.
Technical Name: ResolveLookupFieldFunc
Properties
- Execution Mode: SYNC
- Type: NATIVE
- Category: System Functions
- Function ID:
8f9a1ea8-5d9a-4f2b-a8f6-8f6b5d9a1ea2
Input Schema
Required Parameters
| Parameter | Type | Description |
|---|---|---|
mObjectId | string (UUID) | The UUID of the Object to search in |
fieldName | string | The name of the field in the JSON data to search |
Optional Parameters
| Parameter | Type | Description |
|---|---|---|
lookupValue | string | The value to search for as a String. If null, returns null ID |
[Image placeholder: ResolveLookupField function configuration panel]
Input Example
{
"mObjectId": "123e4567-e89b-12d3-a456-426614174000",
"fieldName": "name",
"lookupValue": "Acme Corporation"
}Output Schema
| Field | Type | Description |
|---|---|---|
id | string (UUID) | The ID of the found record (null if lookupValue is null) |
found | boolean | Whether a record was found |
error | string | Error message if no record was found or an error occurred |
Output Example
Success Response
{
"id": "789e4567-e89b-12d3-a456-426614174001",
"found": true
}Error Response
{
"error": "No record found for name = Acme Corporation",
"found": false
}Null Lookup Value
{
"id": null
}[Image placeholder: ResolveLookupField output visualization]
How It Works
The function performs the following steps:
- Validates Input: Checks that
mObjectIdandfieldNameare provided - Handles Null Values: If
lookupValueis null, returns null ID immediately - Searches MData: Uses
MDataService.findSingleMDataByFields()to find a record where the specified field matches the lookup value - Returns Result:
- If found: Returns the record's UUID and
found: true - If not found: Returns an error message and
found: false
- If found: Returns the record's UUID and
Use Cases
Data Import with Lookup Resolution
Convert string values to record IDs during data import:
{
"mObjectId": "bank-mobject-uuid",
"fieldName": "bank_name",
"lookupValue": "Chase Bank"
}Workflow Lookup Resolution
Resolve lookup fields in workflow processing:
Start → ParseCSV → ResolveLookupField(Bank) → InsertMData → End[Image placeholder: Workflow example]
Conditional Lookup
Handle optional lookup values:
{
"mObjectId": "vendor-mobject-uuid",
"fieldName": "vendor_code",
"lookupValue": "${csv.vendor_code}"
}If lookupValue is null or empty, the function returns null ID without error.
Notes
- The function searches for an exact match on the specified field
- Only the first matching record is returned if multiple records exist
- Field matching is case-sensitive
- Commonly used in file import workflows to convert text values to record references
Related Functions
- Resolve Picklist Field - Resolve picklist fields by finding picklist items by name for a given category
- Fetch MData - Retrieve MData records with filtering and pagination
- Insert MData - Create new MData records
- Parse CSV - Parse CSV files with automatic lookup field resolution