In a process, I need to retrieve the value of a field, using Velocity script.
I'm using :
#set($myfield = $RtCache.getField("field_guid"))
But, when I try to retrieve the value of the field, it doesn't working.
I tried :
$myfield.get(0) and stop counting my tests...
19.09.2016 15:00 von oliv
in what kind of process do you want to use velocity script?
Groovy is usually used in processs.
So far I know, in Process you can use velocity in Email-Aktion for email content.
20.09.2016 06:37 von lisaL
Thank you for your answer.
it was in "text feed action" from intrexx share actions. In content tab, you've an 'open velocity editor' option.
In fact, it seems we don't access to the current data group insert when the action is running so I've done an SQL request like this:
#set($champ = $RtCache.getField("guid"))
#set($stat = $PreparedQuery.prepare($DbConnection, "SELECT $champ.getColumnName() FROM $champ.getTableName()"))
#set($rs = $stat.executeQuery())
#foreach($element in $rs)
I'll add a condition to select only the last save.
Maybe you've another method?
20.09.2016 07:26 von oliv
Ok, as a better method, I finally used 'plugin feed action' because I'm automaticaly mapped with the current data group.
Thanks for your help.
20.09.2016 09:34 von oliv