Is there a way to display only the last (any number) of characters in a custom text field? | Community
Skip to main content
Level 4
September 16, 2020
Solved

Is there a way to display only the last (any number) of characters in a custom text field?

  • September 16, 2020
  • 3 replies
  • 2427 views

Hi community, we have a custom field in a task custom form to capture notes. Is there a way to only display the last xxxx number of characters entered, and not the whole content entered in the field? as more notes get entered, it is getting quite long when it displays in a report.

I know how to do that on the Last Note - Note Text from the updates, but cannot figure out in a custom field.

Thank you!

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 AdinaPi1

Try this:

valueexpression=CONCAT(RIGHT({DE:Multimedia Notes},2100))

3 replies

Level 9
September 16, 2020

Update: use this valueexpressionfor first x characters:

valueexpression=CONCAT(LEFT({DE:Custom Field},100),"...")

_______

Here is code I have for one of my custom fields, let me know if this works for you. Just replace the 5 instances of KR Status Rationale to be your custom field name.

displayname=

linkedname=direct

namekey=KR Status Rationale

querysort=DE:KR Status Rationale

textmode=true

valueexpression=IF(LEN({DE:KR Status Rationale})>140, CONCAT(SUBSTR({DE:KR Status Rationale},0,139),"..."))

valuefield=KR Status Rationale

valueformat=HTML

Level 4
September 17, 2020
Thank you Adina, that worked! But what if I need it to display the last xxx characters? I tried the below value expression as a test. I get the last 2100 characters, but is there a way to get the last xxx characters regardless of the length? valueexpression=IF(LEN({DE:Multimedia Notes})>140, CONCAT(SUBSTR({DE:Multimedia Notes},900,3000)))
AdinaPi1Accepted solution
Level 9
September 17, 2020

Try this:

valueexpression=CONCAT(RIGHT({DE:Multimedia Notes},2100))

Level 4
September 17, 2020
That worked. Thank you!
Level 9
September 17, 2020

Just wanted to update my code that I provided for the first x characters, since I found a new way using left instead of SUBSTR:

valueexpression=CONCAT(LEFT({DE:Custom Field},100),"...")

Level 4
September 17, 2020
Thanks!