Skip to main content
Version: 1.3.0

Camel Case

Text Processing String Manipulation

Synopsis

Converts strings to camelCase format.

Schema

- camelcase:
field: <ident>
target_field: <string>
fields: <array>
exclude: <array>
description: <text>
if: <script>
ignore_failure: <boolean>
ignore_missing: <boolean>
on_failure: <processor[]>
on_success: <processor[]>
tag: <string>

Configuration

The following fields are used to define the processor:

FieldRequiredDefaultDescription
fieldN-Single field to convert to camelCase
target_fieldNSame as fieldTarget field to store camelCase result
fieldsN-Array of fields to convert to camelCase
excludeN-Array of fields to exclude from conversion
descriptionN-Explanatory note
ifN-Condition to run
ignore_failureNfalseContinue processing if conversion fails
ignore_missingNfalseSkip processing if referenced field doesn't exist
on_failureN-See Handling Failures
on_successN-See Handling Success
tagN-Identifier

Details

Converts string values to camelCase format by removing spaces, hyphens, underscores, and other separators, then capitalizing the first letter of each word except the first. The processor handles various input formats including snake_case, kebab-case, space-separated words, and mixed formats.

The processor can work on individual fields using the field parameter or multiple fields using the fields array. When processing multiple fields, the exclude parameter allows you to skip specific fields.

note

camelCase format capitalizes the first letter of each word except the first word, resulting in format like "firstName", "userAccountName", or "dataProcessingComplete". The first letter of the entire string remains lowercase.

The conversion handles Unicode characters properly and preserves non-alphabetic characters in their appropriate positions within the camelCase result.

warning

If the field contains non-string values, the processor will attempt to convert them to strings before applying camelCase conversion. Complex objects or arrays may produce unexpected results.

Examples

Basic Field Conversion

Converting a field to camelCase format...

{
"user_name": "john_doe_admin"
}
- camelcase:
field: user_name
target_field: camel_name

converts to camelCase:

{
"user_name": "john_doe_admin",
"camel_name": "johnDoeAdmin"
}

Space-Separated Words

Converting space-separated words to camelCase...

{
"event_type": "user login successful"
}
- camelcase:
field: event_type

transforms spaces to camelCase:

{
"event_type": "userLoginSuccessful"
}

Multiple Fields

Converting multiple fields at once...

{
"first_name": "john_smith",
"last_name": "doe_williams",
"email_address": "[email protected]",
"phone_number": "555-123-4567"
}
- camelcase:
fields: ["first_name", "last_name", "email_address"]
exclude: ["phone_number"]

processes specified fields only:

{
"first_name": "johnSmith",
"last_name": "doeWilliams",
"email_address": "johnDoe@exampleCom",
"phone_number": "555-123-4567"
}

Mixed Format Input

Handling mixed separators and formats...

{
"mixed_string": "user-account_name with spaces"
}
- camelcase:
field: mixed_string
target_field: camel_string

normalizes all separators:

{
"mixed_string": "user-account_name with spaces",
"camel_string": "userAccountNameWithSpaces"
}

Conditional Processing

Converting to camelCase based on conditions...

{
"field_name": "api_response_data",
"format_style": "camel"
}
- camelcase:
field: field_name
if: "logEntry.format_style == 'camel'"

applies conversion when condition matches:

{
"field_name": "apiResponseData",
"format_style": "camel"
}