Adding conditional text/formatting in email template Workflow Cloud

  • 1 December 2022
  • 1 reply
  • 18 views

Hi All,





In my form, I have check boxes which allows a multi-selection by the user.



Based on certain conditions, an email will trigger to an external party. If more than 1 box is selected, I need to include either "and" or ";" in the email, so it doesn't show as run on text.





Eg the email currently looks:





  • If selecting 3 options: "Box 1 Box 2 Box 3"


  • If selecting 2 options; "Box 2 Box 3"


  • If selecting 1 option; "Box 1"




I need it to look like





  • If selecting 3 options: "Box 1; Box 2 and Box 3"


  • If selecting 2 options; "Box 2 and Box 3"


  • If selecting 1 option; "Box 1"




Is there a way this can be done?


1 reply

Badge +12

Hi @dadams 

you could give it a try with form variables. The idea being that the final string to add into the email is in a form variable. (you may need to add the form variable to a label control on the form for the variable data to be available in the workflow actions.)

Apologies I haven’t worked all through it but on some of the handy functions you can check out would include:

The count function to find how many selections to join together. You can also use the insert function to add in the ‘;’ or ‘and’ or possibly the replace function. ConvertToString will join all the selection as comma seperated text string. You might also need to use Length to get the character length of the selection values to find the index position to inert or replace at.

 

Option two would be to do this in the workflow with a loop action, branch on condition and build strings.

Reply