How do you display a list of a service request's parameters in an email

Version 1

    Details

    For service requests that have many parameters, how do you display those values in an email? This would be mainly used during the fulfillment stage of a request offering, normally in a Notification block.


    Resolution

    You can use the function ForEachChild() to build a list of the parameter values along with the display names.

    The following formula will print all display names of the service request parameters along with the values. The formula would be placed in the body of a notification or to fill out a text area field. Using a text field is not advised as the output is multi-line.


    The '\r\n' at the end will enter a new line.

    $(ForEachChild("ServiceReq#", RecId, "ServiceReqParam#.", "'' + [ServiceReqTemplateParam#.]DisplayName + ': ' + ParameterValue + '\r\n'"))

    Due to the way the values are stored in the system, their output may differ from what the user sees in the service request.

    The following form attempts to use all the types:


    The notification output returns the following data:

    Date Field: 2014-07-18T00:00:00.0000000
    Time Field: 1900-10-10T02:30:00.0000000
    Date / Time Field: 2014-07-19T14:57:00.0000000Z
    Upload Attachment: kitty_thumb.JPG
    List: CRM Service~^Demo Service~^Employee Development~^Mobile Communication
    Text Area: TextAreaNotFUll
    Dropdown Selection: Payroll Administration
    Check Box: true
    Text, Number or Mask Field: CheckTrue


    As of 2014.3,you can also nest the Replace() function inside to automatically format lists with the desired delimiter.

    $(ForEachChild("ServiceReq#", RecId, "ServiceReqParam#.", "'' + [ServiceReqTemplateParam#.]DisplayName + ': ' + Replace(ParameterValue, '~^', ', ') + '\r\n'"))

    Returning: 
    Date Field: 2014-07-18T00:00:00.0000000
    Time Field: 1900-10-10T02:30:00.0000000
    Date / Time Field: 2014-07-19T14:57:00.0000000Z
    Upload Attachment: kitty_thumb.JPG
    List: CRM Service, Demo Service, Employee Development, Mobile Communication
    Text Area: TextAreaNotFUll
    Dropdown Selection: Payroll Administration
    Check Box: true
    Text, Number or Mask Field: CheckTrue