My favorite code snippet for reporting... what's yours? | Community
Skip to main content
Level 10
October 28, 2016
Question

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

  • October 28, 2016
  • 18 replies
  • 3452 views

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.

18 replies

Level 4
October 28, 2016
I love it! Thanks for sharing.
Level 4
October 28, 2016

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

KatColbourn
Level 2
October 28, 2016
This is great, Narayan. Thank you!
NRYNRAuthor
Level 10
October 28, 2016

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

June 25, 2020

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

Level 3
November 11, 2016
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.
NRYNRAuthor
Level 10
November 14, 2016

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

Level 3
November 14, 2016
Narayan, thanks a ton! This text mode code is exaclty what I was looking for. Hope you have a great week!
Level 9
November 19, 2016

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

imgrund
Adobe Employee
Adobe Employee
November 21, 2016

My favorite snippet of code is doing a task collection on a project report. This way I can get all the project information for a status report but can also include the incomplete tasks due in the next week.

[Side note: One issue that makes some groups not like this is that tasks don't come back in chronological order. Wanted to give you that heads up]

displayname=Tasks For The Next Week

listdelimiter=

listmethod=nested(tasks).lists

textmode=true

type=iterate

valueexpression=IF({plannedCompletionDate}<$$TODAYe+5d,IF(ISBLANK({actualCompletionDate}),CONCAT({name}," (",{plannedCompletionDate},") || ")))

valueformat=HTML

Level 9
November 23, 2016
Narayan, Greg (and Kathy), this is great. I've taken parts of Narayan's and Kathy's code to just have an icon and show last condition update upon hover on my projects I'm on page. Thanks!