Monetize360

Resolve Picklist Field

Resolve picklist fields by finding picklist items by name for a given category, returning the item ID

Resolve Picklist Field

Resolve picklist fields by finding picklist items in a specified category where the item name matches a given value. Returns the UUID of the matching picklist item, which is useful for converting string values (like picklist item names) into picklist item IDs for data import and workflow processing.

Technical Name: ResolvePicklistFieldFunc

Properties

  • Execution Mode: SYNC
  • Type: NATIVE
  • Category: System Functions
  • Function ID: 9f9a1ea8-5d9a-4f2b-a8f6-8f6b5d9a1ea3

Input Schema

Required Parameters

ParameterTypeDescription
categoryIdstring (UUID)The UUID of the Picklist Category to search in

Optional Parameters

ParameterTypeDescription
picklistItemNamestringThe name of the picklist item to search for. If null, returns null ID

[Image placeholder: ResolvePicklistField function configuration panel]

Input Example

{
  "categoryId": "123e4567-e89b-12d3-a456-426614174000",
  "picklistItemName": "Active"
}

Output Schema

FieldTypeDescription
idstring (UUID)The ID of the found picklist item (null if picklistItemName is null)
foundbooleanWhether a picklist item was found
errorstringError message if no item was found or an error occurred

Output Example

Success Response

{
  "id": "789e4567-e89b-12d3-a456-426614174001",
  "found": true
}

Error Response

{
  "error": "No picklist item found with name 'Active' in category 123e4567-e89b-12d3-a456-426614174000",
  "found": false
}

Null Picklist Item Name

{
  "id": null
}

[Image placeholder: ResolvePicklistField output visualization]

How It Works

The function performs the following steps:

  1. Validates Input: Checks that categoryId is provided
  2. Handles Null Values: If picklistItemName is null, returns null ID immediately
  3. Searches Picklist Items: Uses PicklistItemService.getItemsByCategory() to retrieve all items in the category, then filters for a case-insensitive match
  4. Returns Result:
    • If found: Returns the picklist item's UUID and found: true
    • If not found: Returns an error message and found: false

Matching Behavior

  • Case-Insensitive: The function uses case-insensitive matching (equalsIgnoreCase)
  • Trimming: Whitespace is automatically trimmed from the picklistItemName before matching
  • First Match: Only the first matching item is returned if multiple items exist with the same name (case-insensitive)

Use Cases

Data Import with Picklist Resolution

Convert string values to picklist item IDs during data import:

{
  "categoryId": "status-category-uuid",
  "picklistItemName": "Active"
}

Workflow Picklist Resolution

Resolve picklist fields in workflow processing:

Start → ParseCSV → ResolvePicklistField(Status) → InsertMData → End

[Image placeholder: Workflow example]

Conditional Picklist Resolution

Handle optional picklist values:

{
  "categoryId": "priority-category-uuid",
  "picklistItemName": "${csv.priority}"
}

If picklistItemName is null or empty, the function returns null ID without error.

Notes

  • The function searches for a case-insensitive match on the picklist item name
  • Only the first matching item is returned if multiple items exist
  • Matching is performed after trimming whitespace from the item name
  • Commonly used in file import workflows to convert text values to picklist item references
  • The picklist category must exist and contain items for the function to succeed
  • Resolve Lookup Field - Resolve lookup fields by finding MData records based on field name and value
  • Parse CSV - Parse CSV files with automatic picklist field resolution
  • Insert MData - Create new MData records with picklist field references