Symptom
- The OData API returns the FormattedText field of the ActivityText entity with double-encoded HTML tags (HTML entities).
- A consuming third-party system cannot interpret the text correctly, resulting in unreadable content.
- The behavior is reproducible across tenants.
Environment
SAP Cloud for Customer
Reproducing the Issue
- Run a GET request on ServiceRequestCollection to retrieve the ticket id.
- Extract the related activity id from the response.
- Run a GET request on ActivityCollection using the extracted activity id.
- Review the FormattedText field in the ActivityText payload and observe the double-encoded HTML entities.
Cause
The FormattedText field in the ActivityText entity contains double-encoded HTML tags that are standard HTML entities.
Resolution
- Implement HTML entity decoding on the consumer side before processing or rendering the FormattedText field.
- Use a standard HTML entity decoder available in the integration or application layer (for example, a built-in library or utility in your programming language).
- Validate the decoded output to ensure the expected HTML structure is restored and can be parsed/rendered by the consuming system.
- Note that the OData API returns FormattedText in its default encoding and this behavior cannot be changed currently.
See Also
Keywords
odata, activitytext, formattedtext, html entities, decode html, text encoding, memoactivitytext , KBA , LOD-CRM-INT-API , OData API (C4C Only) , Problem
Product
SAP Cloud for Customer core applications all versions
SAP Knowledge Base Article - Public