AnsweredAssumed Answered

Extract words from a string and replace them with field content

Question asked by mjhduncker on Nov 14, 2018
Latest reply on Nov 14, 2018 by mjhduncker

Hi all,


Let me explain,


I have to use several e-mail templates and i want to work with bookmarks, so i can find a field in a text string and convert (merge) it back to data from that field.


What have i done so far,


Made a simple table with e-mail templates, in a record the field header and a field body. (and an id of course)


The header field content looks like : "McBean Reportnummer: $audit::reportnumber project: $audit:projectnumber"


You see where i am going with the $audit::reportnumber :-)


The result to use with the send mail command in the subject :


McBean Reportnumber: I180354 project: AVG3682


So far I used a script to do this:


-Replace all space with a enter, so i have a value list
-Delete empty lines-Then extract lines starting with a $ from that value list to a new list

-Use the substitute and getfield function to replace all bookmarks starting with $ for the content of the field


Nice this is working but it took me a whole page of scripting to get the job done.


Can anyone assist me to build a function for this ?


Thnx all.