Example 3: Escape special characters in source data
This example demonstrates how you can use Mapper Snap to customize source data containing special characters so that it is correctly read and interpreted by downstream Snaps.
Add custom JSON data in the JSON Generator Snap, and the values of field1
and field10
include the special character (').
The output preview of the JSON Generator Snap displays the special character correctly.
Before you send this data to downstream Snaps, you might need to prefix the special characters with an escape character so that downstream Snaps correctly interpret them. You can do this with the Expression field in the Mapper Snap. Based on the accepted escape characters in the endpoint, you can select from the following expressions:
If the Escape Character is | Use Expression | Sample Output |
---|---|---|
Single quote (') | JSON:
OR
CSV:
| |
Ampersand (&)
| JSON:
OR
CSV:
| |
Backslash (\)
| JSON:
Backslash is configured as an escape character in SnapLogic®. Therefore, it must itself be escaped to be displayed as text. CSV:
|
Customize the data to be passed to the downstream Snaps using the Mapper Snap Expression field. Learn more about Escaping Single Quotes in Error Pipeline - Issue.
To successfully reuse pipelines:
Download and import the pipeline into the SnapLogic platform.
Configure Snap accounts, as applicable.
Provide pipeline parameters as applicable.
Have feedback? Email documentation@snaplogic.com | Ask a question in the SnapLogic Community
© 2017-2024 SnapLogic, Inc.