Truncating repeater values?



Alright man I just don’t get what I am doing wrong. I can’t get anything to work conditionally. I have attached the file. Check on page 2 of this file.

I have the conditions shut off.

The setup logic is: IF the string called from the repeater source is greater than 8 char, THEN truncate the text and add the elipses. ELSE IF the string is less than 8 char just print the repeater source text as is.

sorry man, thanks for the help!tooltip truncation.rp (89.1 KB)


No worries. This should show what’s going on.

The upshot of it:

If [[item.nameLast.length]] is greater than "10"
    Set text on repeater.nameLast equal to "[[item.nameLast.substr(0,10)]]..."
Else If True
    Set text on repeater.nameLast equal to "[[item.nameLast]]"


Very helpful adaption @aconwell


The conditional isn’t really necessary here. You could use the first case only without the condition. If the string is less than 10 characters then nothing happens since if the ending index supplied to substr is beyond the length of the string then the whole string is returned.


The conditional is there to add the ellipsis. Otherwise, short last names would appear like “Smith…”


Oh, hah. That got cut off perfectly in the formatted text area. Didn’t even see it.


Thank you for this! It really helped me deal with a massive truncation challenge I was facing in my prototype!