Skip to main content
kavithat276137
January 30, 2025
Question

Show comment by default in the comment history if there is no comment added remove the space.

  • January 30, 2025
  • 4 replies
  • 0 views

Hi Everyone,

am trying to add comment history to capture the comments added by the user and stages of the approval.

Requirement is to show the comment by default, if user not added the comment remove the space. 

Below is the reference code. But the condition seems not working.

Thanks to help here to learn more!

4 replies

stefanhelzle0001
January 30, 2025

Hm ... your local would only react on the first comment being empty. But not for every item in the list. So you will have to check the comment being empty inside each element.

mikes0011
Brainy
January 30, 2025

Why isn't your "showWhen" condition checking the existence of the same plaintext you're displaying in your "richTextItem" component?  That's step 1, if you want each comment cell's visibility to be determined by the contents of that cell (rather than, as Stefan mentioned already, the contents of just the first item in the list).

mathieud0001
January 30, 2025

Why not just do an isNullOrEmpty on the relationship for isCommentAvailable?

gayatria0439
February 7, 2025

Hi [mention:0b7bd2212f78464d91d9e8df64047db1:e9ed411860ed4f2ba0265705b8793d05] ,

We should use a!isNotNullOrEmpty() for the specific item in the comments section. The expression a!isNotNullOrEmpty(fv!item[comment]) will display the comment data if a comment is present; otherwise, it will not display anything. we can handle this using Rich Text by writing a condition at showWhen to manage the display logic.

for logic go through this (Appian Community)