AnsweredAssumed Answered

gel: dynamic variables containing html

Question asked by Danpego on Jun 13, 2017
Latest reply on Jun 22, 2017 by gcubed

I need to fill a var (core:set) with rows from a query(variable num of rows)

Also I want to add html tags(<BR></BR>) between rows in order to be able to send the string by email (gel:email) with format.

 

I am finding problems creating the string:

  • using concat()  [with escapetText=1 or 0]
    • codeprev.concat(text.concat(codepost))
      • <core:set var="codeprev"> <BR> </core:set>
        • when save; UI BPM-0703: Custom script syntax error at line , column : The element type "BR" must be terminated by the matching end-tag "</BR>".
      • <core:set var="codeprev"> &lt;BR&gt; </core:set>
        • code is displayed in email as escaped but it is not interpreted
  • in the content of core:set
    • <core:set var="var_text" escapeText="0"><br>${text}</br><br>${text}</br></core:set>
      • it works fine but it is not dynamic
    • var inside a foreach
      • <core:forEach>        
                <core:set value="${slRow.field}" var="text"/>            
                <core:set var="var_string">${var_string}<BR>${text}</BR></core:set>        
         </core:forEach>
      • tested with different combinations of  escapeText, when displaying the var, it always shows escaped html codes, and just the text from the last row is displayed properly.

                        Example of email

                              <br>textstring1</br>
                               textstring2

 

The main reason for creating a string containing html is that I would like to make persist and use in a later action/step.

Outcomes