Skip to main content
Sven-iX
Community Advisor
Community Advisor
Oct 5, 2024 9:11 AM UTC
New

Allow HTML in iterator (textMode)

When using valueexpression in an iterator, I'd like to be able to emit simple HTML concatenated with object attributes to, e.g. create an img tag or a link. 

Currently a valueexpression is printed as string, not HTML

 

Usecase

On certain tasks we attach documents (images), usually 1, sometimes 2. 

In a task report I'd like to see the thumbnails of these attachments. 

 

I can iterate over documents but I can't display a thumbnail. Using HTML would address that: 

valueexpression='<img src=/internal/document/thumbnail?build=&size=MEDIUM&documentVersionID='+{currentVersion}.{ID}+'&ID='+{ID}+'/>'

listdelimiter=<hr/>

listmethod=nested(documents).lists

valueformat=HTML

textmode=true

type=iterate

 

additionally I'd like to do the same in plain valueexpression statements (ie no iterator) but Workfront parses the string and when it detects <img or <a it emits as string, not HTML

 

1 reply

ChrisFrancis93
Level 2
Nov 4, 2026 9:37 PM UTC

I have not been able to do this on an iteration but you can accomplish what you are wanting in a plain valueexpression.  For instance the below will work on a document report.  It uses share cols and the value param (instead of valueexpression or valuefield). the first col opens the image tag with value=<img.  The second col uses valueexpression to build your html attributes for the image tag.  and the third col closes the image tag with value=/>. adding sharecol=true to the first 2 columns combines them into a single column and it renders correctly.  You have to make sure that all of your parameters in column 2 are valid html but this works. Included a screenshot of my report example as well
 

column.0.value=<img

column.0.valueformat=HTML

column.0.textmode=true

column.0.sharecol=true

column.0.displayname=Thumbnail

column.1.displayname=params

column.1.valueexpression=CONCAT(" src=/internal/document/thumbnail?build=&size=MEDIUM&documentVersionID=",{currentVersionID}, "&ID=", {ID})

column.1.valueformat=HTML

column.1.sharecol=true

column.2.value=/>

column.2.valueformat=HTML

column.2.textmode=true

column.2.displayname=Close Thumbnail

 

 

Translate