SAP Knowledge Base Article - Public

3616786 - Hard line breaks are not copied via commenting API in SAP Analytics Cloud

Symptom

  • Table_1.getDataSource().getComments().addComment/Comments(); 
  • Hard line breaks are not copied when adding comments via scripts, but copied as soft line breaks.
    • Hard line break: Press [Enter] key.
    • Soft line break: Press [Shift+Enter] key.
  • When manually copying a comment that has a hard line break applied in comment editor, the hard line break is maintained.

Environment

SAP Analytics Cloud

Reproducing the Issue

  1. Apply addComment() scripts in Button.onClick.
  2. Check the comment to be copied: "we [hard line break] are".
  3. Click on Button to run addComment() scripts, where copied the same text to the comment thread.
  4. Double click on comment cell, and notice the copied text displays as "we [soft line break] are", instead of "we [hard line break] are".

Cause

The hard line break is actually rich text with mark language like "<p>we</p>\n<p>are</p>".

Commenting API currently do not support Rich Text as input, only plain text is supported.

Resolution

This is the designed behavior for commenting API.

See Also

Your feedback is important to help us improve our knowledge base.

Keywords

hard line break, soft line break, comments, script, sap analytics cloud, unified story scripting, table_1.getdatasource().getcomments(), rich text, plain text, unexpected behavior, copying comments, line breaks, paste, transfer , KBA , LOD-ANA-UNS-SCR , Unified Story Scripting related Issues , Problem

Product

SAP Analytics Cloud all versions