cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

FSM Business Rule: Usage of JavaScript in HTML construct

christoph_kurtz2
Participant
1,490

Hi all,

We are struggling with an issue of the JavaScript integration into HTML code while creating a business rule in FSM.

The business case is that we want to use several equipments in one service call. After assignment of the related activity to the technician, he should receive an email with the list of the affected equipments. For one equipment, this works very well.

Here is the example when one equipment is listed

We want to loop over all assigned equipments and want to display them in a HTML table row. To realize that, we want to add related Javascript code into the HTML source within the <script>-tags.

After saving the source and reopen it, the tags <script> and the content in-between are deleted. Moreover, the code is not executed when assigning new activities to orders.

Do you have any idea how we can solve this situation?

Best regards,

Christoph

View Entire Topic
wendy_snyder
Advisor
Advisor

Hi Christoph, It is not possible to use the script tags in an email. We would propose to use a variable (i.e equipments) for your array and then in the email you could access these equipments via this variable and print them out using a script like below:

${equipments.map(function(equipment){return "id: " + equipment.id + " name: " + equipment.name + " code: " + equipment.code})}

If this is not sufficient, can you please send me what you are trying to do in the script?

Kind Regards,

Wendy