Making report descriptions show up with specific wordcount using textmode | Community
Skip to main content
New Participant
August 4, 2023
Solved

Making report descriptions show up with specific wordcount using textmode

  • August 4, 2023
  • 2 replies
  • 807 views

Hi All, 

 

Trying to figure out how to code in text view so that when users see the dashboard the request description can only be up to 20 or so words and then show a "...".

 

For example:

 

The original request: It is important that someone walks the dog today. 

 

I want code to make it so the users only see 2 of the words in this request so that it shows:

 

It is... 

 

and then can click into the request to see more details

 

Hope this makes sense and thank you in advance if you have a solution!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by NicholeVargas

@rachelba2 I'm not sure how familiar you are with text mode, but in case you aren't able to figure out how to repurpose the example in the Reporting Cookbook (page 7-8) here is the text mode you can use for a shortened description -- this one looks as 20 characters or less:

 

displayname=Description
textmode=true
valueexpression=IF(LEN({description})>20,CONCAT(SUBSTR({description},0,19),"..."))
valueformat=HTML

2 replies

NicholeVargasAccepted solution
Employee
August 4, 2023

@rachelba2 I'm not sure how familiar you are with text mode, but in case you aren't able to figure out how to repurpose the example in the Reporting Cookbook (page 7-8) here is the text mode you can use for a shortened description -- this one looks as 20 characters or less:

 

displayname=Description
textmode=true
valueexpression=IF(LEN({description})>20,CONCAT(SUBSTR({description},0,19),"..."))
valueformat=HTML

RachelBa2Author
New Participant
August 7, 2023

Hi! Thank you so much for your help. I tried your code and it is not seeming to work. This is what I have so far: 

Request=Description="..."
linkedname=direct
namekey=Request Description
styledef.case.0.comparison.icon=false
styledef.case.0.comparison.leftmethod=DE:Is this an Urgent Request?
styledef.case.0.comparison.lefttext=DE:Is this an Urgent Request?
styledef.case.0.comparison.operator=in
styledef.case.0.comparison.operatortype=string
styledef.case.0.comparison.righttext=Yes
styledef.case.0.comparison.trueproperty.0.name=bgcolor
styledef.case.0.comparison.trueproperty.0.value=eac6c9
styledef.case.0.comparison.truetext=
textmode=true
tile.name=component.customdata.richtextlistview
type=tile
valueexpression=IF(LEN({Request Description})>20,CONCAT(SUBSTR({Request Description},0,19),"..."))
valuefield=Request Description
valueformat=customDataRichTextAsString

 

Employee
August 7, 2023

@rachelba2 Based on the text mode you shared above, it looks like you are trying to combine 2 different fields, Is this an Urgent Request? and this new, shortened description column into a column rule. Can you share more details as to exactly what you are hoping for?

If you don't want to apply conditional formatting and you just want the column to show a shortened description, you can just use the four lines of text move above. 

skyehansen
New Participant
August 4, 2023