Issue
When configuring a data destination mapping between Segment and Iterable, a field intended as a boolean is automatically changed to a string after saving and running the audience configuration. This results in a 400 Bad Request error from Iterable, with the message:
RequestFieldsTypesMismatched: Field '[field_name]' already exists for type 'user' and has a data type of 'boolean' but possible types 'string, keyword' in the request.The error occurs because Iterable expects a boolean, but Segment sends a string value.
Product
Twilio Segment
Environment
Segment Console
Cause
This issue is caused by trailing newline characters (\n) in the field values, which were inadvertently added during copy-pasting when configuring the mapping. These characters change the field type from boolean to string in the database. While Segment now strips newlines from new fields, existing affected fields require manual cleanup.
Note: The UI display showing "string" instead of "boolean" is a cosmetic issue and does not affect the actual data sent.
Resolution
To resolve the issue for each affected mapping:
- Navigate to the affected mapping in Segment Console.
- Scroll to the field mappings section.
- For each affected field:
- Click the trash icon to completely delete the field.
- Click "Add Mapping Field" and re-add the same field, entering the value carefully (avoid copy-pasting with trailing spaces or newlines).
- Click Save.
- Repeat for all affected mappings.
- Wait for the next sync and verify that 400 errors have stopped in the delivery logs.
Editing the field value alone will not work; the field must be deleted and re-added to clear the stored newline character.
Additional Information
- Segment now automatically strips newlines from new fields, but existing fields need this one-time manual cleanup.
- The UI icon display issue is separate and does not cause 400 errors.
- For a list of affected mappings, refer to your delivery logs or support correspondence.