How to limit the number of characters returned by a placeholder

Version 5

    Verified Product Versions

    LANDESK Service Desk 7.7.xLANDESK Service Desk 7.8.xLANDESK Service Desk 2016.xLANDESK Asset Central 2016.x

    You can use placeholders within assignment, reminder and SLA notifications to include dynamic values when sending emails to users.  The format for this is generally {AttributeName} or {RelationshipName/AttributeName}.  There is sometimes a need to limit the number of characters returned when a placeholder is evaluated to ensure control over the overall length of the resulting text.

     

    This is possible using the format {AttributeName:length}.

     

    For example if an incident title is "This title text is forty characters long" (which is 40 characters long), you can use this title in an assignment email subject by using the placeholder {Title}.

     

    However if you want to include other text in the subject and guarantee you'll keep within the character limit of the assignment attribute's length you can force the placeholder to only evaluate 20 characters of the incident title using {Title:20}.  This will return "This title text i..." which is 20 characters long including the "..." suffix added to indicate the text was truncated.

     

    If your source text length is equal to or shorter than the number specified in the placeholder then the full text will be returned and "..." is not suffixed.

     

    Using this on DateTime attributes

    There are a couple of limitations with using this technique with DateTime attributes.  For more information and an alternative method please see ths following document: How to limit a DateTime placeholder for email or a Web Access report template.