Expand my Community achievements bar.

SOLVED

Making report descriptions show up with specific wordcount using textmode

Avatar

Level 1

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!

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

@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

View solution in original post

4 Replies

Avatar

Correct answer by
Employee Advisor

@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

Avatar

Level 1

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

 

Avatar

Employee Advisor

@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.