Send List as Attachment in Email Tool

Introduction

In this article, you'll learn how to send a list as an attachment using the Email Tool in Joget DX. This feature allows you to automate the distribution of list data via email in various formats such as CSV, Excel, XML, or PDF. Configuring the Email Tool with dynamic filters and export links allows you to customize the data sent to your recipients based on specific criteria.

How does it work?

To send a list as an email attachment, you first need to generate the list in the UI, copy the export link, and configure the Email Tool with that link. Additionally, you can apply dynamic filters using hash variables and list filter URL request parameters to customize the data based on real-time conditions.

  1. In runtime, go to the UI menu containing the desired list (e.g., List Inbox, CRUD).
  2. At the bottom of the UI menu, find the export link for your desired format (CSV, Excel, XML, or PDF) and copy the link.
  3. Go to the Attachments tab in the Email Tool.
  4. Paste the copied link into the Path column in the Files property.
  5. Name the file in the File Name column to your preference.
Note: 
For more information about configuring email attachments, see the documentation: Email Tool - Attachments.

Dynamically filter records in list attachment

To make your list attachment more relevant, you can dynamically filter records using Hash Variable and List Filter URL request parameters. This allows you to tailor the data to specific users or conditions.

Example: Dynamically Filter and Send List as a PDF Attachment

In the default Expenses Claims app, you want to filter the records in the My Inbox list to display only the expense claims submitted by the currently logged-in user. After filtering, you'll send the filtered list as a PDF attachment via the Email Tool.

  1. The URL to download a PDF version of the My Inbox list without any filtering might look like this: http://localhost:8080/jw/web/userview/expenseclaim/home/_/myin?6578706f7274=1&d-944469-e=5 
  2. Identify the list filter's URL request parameter. In this example, the parameter for the Submit By filter is d-944469-fn_claimant.
  3. To filter the results in the list attachment, append the filter’s URL request parameter along with its value or a hash variable (e.g., #currentUser.username#) to the URL path. The updated URL will look like this:
    http://localhost:8080/jw/web/userview/expenseclaim/home/_/myin?6578706f7274=1&d-944469-e=5&d-944469-fn_claimant=#currentUser.username#

Related documentation

Download sample app

Download the demo app for Send List as Attachment in Email Tool

This sample app requires Joget DX version 7.0.26 or later, which contains the latest fixes for file attachments in the Email Tool.

Created by Julieth Last modified by Aadrian on Dec 13, 2024