how can I use a variable value within db stored text

1
Hi guys, I'm trying to improve a section of an app and make it more dynamic and easier to maintain and I am removing large chunks of text that were setup in a microflow just prior to creating a template file and have created a simple entity that will be taking the text instead. This in order, will be called upon a particular text type (enum) and used (called) in a microflow. All good so far, however the issue is when there are bits of text that require a variable inserted. For example the following piece of text... "Further to our renewal reminder dated Ā«Reminder_DateĀ» we write to inform you that...bla bla bla". Currently, the microflow will feed the date or any other field in the text via the objects or variables within the microflow, but how can I use the text from an entity attribute and still feed the value of a variable from the microflow in action? So far, I've created a new entity that will take the text and text type (enum), and in the original microflow, I have replaced the several lines of text being set for the template body text with a simple "$myTextObject/theTextValue". Again, all great, but of course the text displayed now shows "Further to our renewal reminder dated' + $someObjectInOriginalMicroflow/ReminderDate + 'we write to inform you that..." I assume I need some kind of a token, but exactly what? When setting the text in runtime, I won't have any details of the objects to use, which could be anything. Would the quotes (') also mess up the result in the microflow? LR.
asked
2 answers
1

Have you considered using templating? You could either insert DISPLAY_NAME strings inside your string and replace them (using the string replaceAll function) or use a java action in combination with a library such as stringtemplate

answered
1

Louis, take a look at the email module and specific the template section. You can modify your own text with tokens that can be filled by a microflow before you save your text. This way you can modify in the front of your application how the text is defined. We use this all the time to modify text.

Regards,

Ronald

answered