Create text action v1.20.0+
The create text action extends the action data syntax allowing these special replace options:
- $a(actionName) replaced with the value from the action data
- $#(startLoop) Start a loop for all rows of the datacube
- $#(endLoop) End of the loop
- $c(columnName) Replaced with value of the defined data columninside the loop
One Action allows one loop only, but multiple actions could simply be added together with the action data replacement.
Examples
Consider we have data with the columns Alpha & Num
XML
Text
='<xml>
<table>
$#(startLoop)
<row>
  <Name>$c(Alpha)</Name>
  <value>
     <label>some fixed text</label>
     <num>$c(Num)</num>
  </value>        
</row>
$#(endLoop)
</table>
</xml>'JSON
For JSON array creation the Remove last character in loop setting can be used to remove the comma after the last object.
Text
='{
   "someArray":[
   $#(startLoop){
       "name":"$c(Alpha)",
       "num":"$c(Num)"
   },$#(endLoop)
   ]
}'Last updated on