Skip to main content

I am relatively new to salesforce so perhaps there is an easy way to accomplish this, but I have been unable to find anything that works as of yet. I am trying to create a text template in a flow that takes input from collection variables and formats it into a neat list. Beyond that, I am trying to set up a template divided into sections, but each section is only included if there is an item in the respective collection variable to populate it (so there will not be a section header over a blank section). I have tinkered around with individual text variables that begin as null and are later filled by collection items, but have found that difficult or impossible to format. Any help is appreciated.

 

@Lightning Flow Discussions 

#Flow
5 个回答
  1. 2022年3月18日 15:20

    If anyone has a similar issue in the future, I will include what I did to solve it here:

     

    The purpose of the formatting was to include the information in a neat email.

    1. Set the email body to be rich text
    2. Created a text variable for each section header and section body (each initialized as empty string)
    3. Add all text variables to text template (viewed as plain text) in the order you want them to appear in the email (no spacing, to be formatted by html tags in the following steps)
    4. If there is an item for a specific section:
      1. Populate section header var with "<p>" tag at start
      2. Add "<ul>" tag to section body var
      3. Loop thru all items for the section, add "<li>[current item]</li>" to section body var
      4. Add "</ul></p>" tags to section body var
      5. If not your last section, also add "<br>" tag to section body var
    5. Use text template as email body

    Empty strings will not be seen in the email.

0/9000