Overview
Sprintf is a dynamic data-mapping feature in eZintegrations that allows users to pass JSON key values from one step to another within the data pipeline.
It enables seamless communication between sources, operations, and targets by inserting runtime values into URLs, headers, payloads, and configurations.
When to Use
Use Sprintf when dynamic values from incoming JSON data must be passed to downstream systems or operations.
- Linking multiple datasets from different sources
- Mapping source and target payloads
- Generating dynamic API request bodies
- Configuring dynamic email recipients and content
- Orchestrating database, SaaS, NoSQL, Data Lake, and email targets
How It Works
Sprintf replaces placeholders in configuration fields with actual values from the flowing JSON data at runtime.
The system resolves each placeholder by matching it with the corresponding JSON key and injecting its value dynamically.
Sprintf Notation
Sprintf uses the following syntax to reference JSON keys.
{%key%}
This notation replaces key with its corresponding value from the JSON dataset.
Handling Integer and Boolean Values
For keys containing integer or boolean values, Sprintf preserves the original data type.
"price": "{%^stock_price^%}",
"status_flag": "{%^status_flag^%}"
This ensures that numeric and boolean values remain unchanged after transformation.
Supported Pipeline Components
Sprintf can be used across multiple components of the eZintegrations pipeline.
- API Data Source
- API Operation
- API Data Target
- Append Operation
- Bizintel360 Datalake Search Operation
- Email Target
- Email Operation
Usage in API Data Source
In API Sources, Sprintf can be applied in endpoint URLs, headers, request bodies, parameters, authorization settings, and pre-request scripts.
Example: Using Sprintf in Params
Sprintf can reference numeric parameters to pass dynamic values.
Minimum and maximum numeric parameter values can be used directly in Sprintf format.
Example: Using Sprintf in Headers
In OAuth 2.0 implementations, Sprintf is commonly used with pre-request scripts to generate authorization headers.
Usage in API Operation
Sprintf can be used in API Operations for authorization and data mapping.
Scenario 1: OAuth 2.0 Authorization
Sprintf retrieves access tokens and inserts them into authorization headers dynamically.
Scenario 2: URL, Headers, and Params Mapping
Sprintf passes values from source JSON to API operation configurations.
Example
Source Data:
{
"id": 1,
"email": "george.bluth@reqres.in",
"first_name": "George",
"last_name": "Bluth"
}
API Operation Mapping:
{%id%}
Usage in API Data Target
In API Targets, Sprintf is used in the same way as in API Sources.
It can be applied to endpoint URLs, headers, bodies, parameters, authorization settings, and pagination logic.
Usage in Append Operation
Append Operation uses Sprintf to create new key-value pairs dynamically from source data.
Example
Append Configuration:
"User ID": "{%id%}",
"Email ID": "{%email%}"
Output:
{
"User ID": 1,
"Email ID": "george.bluth@reqres.in"
}
Usage in Bizintel360 Datalake Search Operation
In Datalake Search Operations, Sprintf is used to match values from source data with stored records.
It enables retrieval of related columns such as Encounter ID and Patient Name based on matched keys.
Usage in Email Target
Sprintf allows dynamic insertion of JSON values into email configurations.
It can be used in CC, BCC, subject, source key, and email body fields.
This enables personalized and context-aware email notifications.
Usage in Email Operation
Email Operations support Sprintf in the same manner as Email Targets.
Sprintf values can be applied in CC, BCC, source key, and body sections.
Source Key Example
{
"items": {
"id": 1,
"email": "george.bluth@reqres.in",
"first_name": "George",
"last_name": "Bluth"
}
}
How to Use
Follow these steps to use Sprintf in eZintegrations.
- Identify the JSON key whose value is required.
- Insert the key using the {%key%} notation.
- Place the Sprintf expression in the required configuration field.
- Save and deploy the pipeline.
- Test the workflow with live or sample data.
Troubleshooting
- Ensure the referenced key exists in the input JSON.
- Verify correct Sprintf syntax.
- Check for case-sensitive key mismatches.
- Confirm data is available at the processing stage.
- Review logs if placeholders are not resolved.
Frequently Asked Questions
What is the main purpose of Sprintf?
Sprintf enables dynamic insertion of JSON values into pipeline configurations.
Can Sprintf be used with nested JSON keys?
Sprintf works with available keys in the current data context.
Does Sprintf change data types?
No. Sprintf preserves original data types when using type-safe notation.
Can multiple Sprintf expressions be used in one field?
Yes. Multiple placeholders can be combined in a single configuration field.
Is Sprintf mandatory for all integrations?
No. It is required only when dynamic value substitution is needed.
Notes
- Use consistent key naming across pipelines.
- Avoid hardcoding static values where Sprintf can be used.
- Test dynamic mappings thoroughly.
- Ensure sensitive data is handled securely.
- Document Sprintf usage for maintenance purposes.