My favorite code snippet for reporting... what's yours? | Community
Skip to main content
Level 10
Oct 28, 2016 12:32 PM UTC
Question

My favorite code snippet for reporting... what's yours?

This is my favorite by far. It can be added to any Project, Task, Issue or Document Report or List view, and gives you a glimpse into the last update on the record including the first 140 characters, the user and the date of the update all in one cell. This can usually eliminate a few clicks into a record to find the latest update.

Just add a column into your view, switch to text mode and paste the following:

displayname=Latest Update

namekey=latest update

textmode=true

valueexpression=IF(LEN({lastNote}.{noteText})>140, CONCAT(SUBSTR({lastNote}.{noteText},0,139),"...(open for more) -- ", {lastNote}.{owner}.{name}," on ", {lastNote}.{entryDate}), IF(LEN({lastNote}.{noteText})>0, CONCAT({lastNote}.{noteText}," -- ", {lastNote}.{owner}.{name}," on ", {lastNote}.{entryDate})))

valueformat=HTML

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

19 replies

Level 9
Nov 19, 2016 1:35 PM UTC

I like this Narayan! Thanks.

I'll add one that I like that Kathy Leeman gave on this community earlier (for those that missed it). This text mode displays a blue circle if there is a detail description (can be used for both Tasks and Issues). And when you mouse over the blue dot, it displays the text. I like this because it saves space on the view, yet you can see the detail without clicking into the Task or Issue.

displayname=

image.case.0.comparison.icon=true

image.case.0.comparison.leftmethod=description

image.case.0.comparison.lefttext=description

image.case.0.comparison.operator=notblank

image.case.0.comparison.operatortype=string

image.case.0.comparison.righttext=

image.case.0.comparison.truetext=/static/img/r15/icons/casebuilder/light_blue.gif

image.namevalue=string(description)

image.valuefield=description

linkedname=direct

shortview=false

textmode=true

valuefield=description

valueformat=HTML

Translate
Level 3
Nov 14, 2016 3:32 PM UTC
Narayan, thanks a ton! This text mode code is exaclty what I was looking for. Hope you have a great week!
Translate
NRYNRAuthor
Level 10
Nov 14, 2016 2:49 PM UTC

This should work. This will just include the description, not any "last updated" information:

displayname=Description

namekey=description

textmode=true

valueexpression=IF(LEN({description})>140, CONCAT(SUBSTR({description},0,139),"...(open for more) -- "), IF(LEN({description})>0, {description}))

valueformat=HTML

Translate
Level 3
Nov 11, 2016 12:56 PM UTC
Narayan, Thank you a ton for sharing this code snippet for Latest Update. I have started using it in many of our reports. By chance, have you figured out the code to do something similiar in the description field? I am not having any luck getting it to work so it shows the first 140 characters.
Translate
NRYNRAuthor
Level 10
Oct 28, 2016 4:11 PM UTC

It just displays reasonably without adding too much vertical scroll and gave us enough information for a preview. Twitter was pretty successful with that count, so they must be doing something right. ‚ò∫

I don’t believe it’s possible to accomplish the time of day on the entry in a single calculated expression. I was able to adjust it and add a second column for the date and time of day, then setup a shared column, to achieve this. It’s not quite as straight-forward, but gives you what you need to get the following format:

Hey, was this just an older request related to the report I provided today giving insight into the BIO, or is this a little ...(open for more) -- Narayan Raum on 10/27/16 7:37 PM

The code behind the columns is:

column.12.displayname=Latest Update

column.12.namekey=latest update

column.12.sharecol=true

column.12.textmode=true

column.12.valueexpression=IF(LEN({lastNote}.{noteText})>140, CONCAT(SUBSTR({lastNote}.{noteText},0,139),"...(open for more) -- ", {lastNote}.{owner}.{name}," on "), IF(LEN({lastNote}.{noteText})>0, CONCAT({lastNote}.{noteText}," -- ", {lastNote}.{owner}.{name}," on ")))

column.12.valueformat=HTML

column.13.sharecol=true

column.13.textmode=true

column.13.valueformat=HTML

column.13.width=1

column.14.displayname=

column.14.linkedname=lastNote

column.14.namekey=view.relatedcolumn

column.14.namekeyargkey.0=lastNote

column.14.namekeyargkey.1=entryDate

column.14.querysort=lastNote:entryDate

column.14.textmode=true

column.14.valuefield=lastNote:entryDate

column.14.valueformat=longAtDate

Translate
New Participant
Jun 25, 2020 6:55 PM UTC

Hi @NRYN R - inactive‚ and @Kruse Collins‚ ,

This is my first post, and I'm new to WF, so please forgive my ignorance. Is there a way to use the "last update" code at the top of this string and have it show ALL updates? I have some users that want to see all updates, and they don't mind scrolling like crazy. Being able to inline edit would be a huge bonus.

Thanks in advance!

Mel

Translate
KatColbourn
Level 2
Oct 28, 2016 3:17 PM UTC
This is great, Narayan. Thank you!
Translate
Level 4
Oct 28, 2016 3:07 PM UTC

Hi Narayan,

Thanks for posting! This is a great addition to status reports. How did you decide on the 140 character limit, just following Twitter's model? Also, is it possible to include the Time of Day on the entry date?

Andrew Beard

Translate
Level 4
Oct 28, 2016 2:22 PM UTC
I love it! Thanks for sharing.
Translate