Formula - startswith
Easily determine if your data starts with a specific value using the Nodinite startswith Formula plugin. This page shows how to validate message Content, Context, or the output of other formulas, ensuring your integrations are accurate and reliable.
π― Designed for business users and integrators β no developer required; you can even use AI to craft expressions.
- β Quickly check if text starts with a given value from any Payload or Context in any Log Event
- β Boolean result (true/false) for conditional logic and filtering
- β Transform and surface meaningful data in Nodinite Log Views, search filters, and self-service diagnostics
- β Combine with other Formula functions for powerful, layered expressions
What does the startswith Formula do?
The startswith formula checks if a text value (string) begins with a specific letter, word, or pattern. If the value matches at the start, the result is true; otherwise, the result is empty. Use this function to filter or validate data in your log views and search fields.
How it works: Input β startswith β Result
Flow: The text is checked to see if it starts with the specified value, returning a boolean result.
Examples
Below are practical examples showing how to check if text starts with a specific value.
Example 1: Message Body as Content
Input
GMT
Formula Expression
startswith('G', body())
Result
true
The result is true because the message body starts with 'G'
Example 2: Message Context as Content
Input
GMT
Formula Expression
startswith('G', context('id'))
Result
true
The result is true because the context value for 'id' starts with 'G'
Example 3: Nested Formula as Content
Input
GMT UTC
Formula Expression
startswith('U', regex('GMT|UTC', body()))
Result
true
The result is true because the regex function extracts 'UTC', which starts with 'U'
Features
The startswith Formula function is highly flexible and can be nested with other formula functions. For instance, combine it with regex, jsonPath, or substring to validate extracted or transformed data.
- Check if text starts with a specific value (case-sensitive)
- Returns boolean
trueorfalsefor conditional logic - Works with message body, Context, or results from other Formula functions
- Ideal for filtering and validating integration data
Important
The startswith plugin loads the entire message into RAM. Only use this function on small messages to avoid performance issues.
How to use
The startswith formula validates if text starts with a specified string. It's ideal for prefix validation, file name checks, or conditional filtering.
Syntax
startswith('value', Content)
Parameters:
- value (string): The prefix string to check for, e.g.,
'G','http','#' - Content (string): The text content to validate, typically from body() or context()
Common patterns:
startswith('G', body())β Check if body starts with "G"startswith('http', context('url'))β Validate URL protocolstartswith('#', context('comment'))β Check comment marker
Use with different sources:
- Check message body:
startswith('prefix', body()) - Check message context:
startswith('value', context('MessageContextKey')) - Check formula result:
startswith('U', regex('GMT|UTC', body()))
Next step
- How to Add or manage Search Fields
- How to Add or manage Log Views
Related Topics
- Body β Extract body from the Log Event
- Context β Extract context values from the Log Event
- endsWith β Check if text ends with a specific value
- equal β Check if values are equal
- regex β Extract data using regular expressions
- jsonPath β Extract values from JSON using JSONPath expressions
- Expression Type Plugins are used in Search Fields
- What are Search Fields?
- What are Search Field Expressions?
- What are Message Types?
- What are Log Views?


