Understanding Loops in Letters and Other LibreOffice Templates
    • 31 Oct 2024
    • 4 Minutes to read
    • Contributors
    • PDF

    Understanding Loops in Letters and Other LibreOffice Templates

    • PDF

    Article summary

    Loops in ACE letters allow you to include dynamic, repeating data in your letter templates. By using loops, you can automatically populate tables with multiple rows of related information, such as lists of debts, transactions, payment schedules, or any custom data sets.

    This article explains how loops work in ACE letters, provides a full list of all available types of loops, and offers detailed examples of how to use them in your letter templates.

    How Loops Work in ACE Letters

    Loops are implemented by using Table Property Names in conjunction with specific loop identifiers recognized by the system. When you set the Table Property Name to a recognized loop name, you are instructing ACE to:

    1. Identify Which Loop is used in the Table: ACE recognizes which loop is used based on its name.

    2. Retrieve Relevant Data: ACE fetches the data set associated with that specific loop from the database.

    3. Populate the Table: The system iterates over the data set and populates the table rows accordingly.

    List of Available Loops in ACE Letters

    Below is the full list of available loops you can use in your ACE letter templates, organized by category:

    1. Bundle Loops

    • bundle_loop: Includes all accounts in a bundle, regardless of their status.

    • new_bundle_loop: Includes only accounts in the bundle with statuses in the NEW status group.

    • active_bundle_loop: Includes only accounts in the bundle with statuses in the ACTIVE status group.

    • bundle_group_loop: Includes accounts in the bundle that match a specific bundle group specified in the letter profile.

    • bundle_trans_owing_loop: Includes all owing transactions for all debts in the bundle.

    • bundle_trans_received_loop: Includes all received transactions for all debts in the bundle.

    2. Itemization Transaction Loops

    • itemization_trans_loop: Includes all itemization transactions after the itemization date.

    • itemization_trans_interest_loop: Includes only interest transactions after the itemization date.

    • itemization_trans_fees_loop: Includes only fee transactions after the itemization date.

    • itemization_trans_payments_loop: Includes only payment transactions after the itemization date.

    • itemization_trans_credits_loop: Includes only credit transactions after the itemization date.

    • itemization_trans_owing_loop: Includes all owing transactions after the itemization date.

    • itemization_trans_received_loop: Includes all received transactions after the itemization date.

    3. Payment and Transaction Loops

    • payments_loop: Includes all payments made on the debt.

    • payment_plan_schedule_loop: Includes the payment dates and amounts scheduled in a payment or promise plan.

    • debt_trans_owing_loop: Includes all owing transactions on the debt.

    • debt_trans_received_loop: Includes all received transactions on the debt.

    4. Legal Case Loops

    • legal_case_loop: Includes information related to legal cases associated with the debt.

    • legal_case_account_loop: Includes accounts associated with a specific legal case.

    • legal_case_defendant_loop: Includes defendants associated with a legal case.

    5. Additional Loops

    • client_form_loop: Includes forms associated with the client.

    • form_loop: Includes specific forms related to the debt or client.

    • client_aging_loop: Includes aging information for the client's accounts.

    • custom_data_loop: Includes custom data fields defined by your organization.

    • sql_loop_[REPORT_IDENTIFIER]: Custom loops based on SQL reports you've created. Replace [REPORT_IDENTIFIER] with the identifier of your SQL report.

      • Note: Setting up custom SQL loops requires advanced configuration and is typically handled by experienced users or ACE support.

    • invoice_loop: Includes data specific to invoicing, such as line items and totals.

      • There are a variety of loops that are strictly used for invoices.

    Setting Up Loops in Letter Templates

    1. Open Your Letter Template in LibreOffice Writer.

    2. Insert a Table for Headers:

      1. Go to Table → Insert Table.

      2. Specify the number of columns you need.

      3. Set the number of rows to 1 (this will be used for the headers).

      4. Do not set a table name for this table.

    3. Add Headers:

      1. In the header table, enter the headers for each column (e.g., Date, Amount, Type).

    4. Insert a Second Table for Data:

      1. Place your cursor below the header table.

      2. Go to Table → Insert Table.

      3. Specify the same number of columns as the header table.

      4. Set the number of rows to 1 (this will serve as a placeholder for the data).

      5. This table will be looped over to include all relevant data entries.

    5. Name the Data Table with a Loop Identifier:

      1. Right-click on the data table and select Table Properties.

      2. In the Table tab, find the Name field.

      3. Enter the appropriate loop name (e.g., bundle_loop, debt_trans_received_loop, etc.).

    6. Insert Data Fields into the Data Table:

      1. Use View → Data Sources to access the ACE data fields.

      2. Expand the relevant tables to find the fields you need.

      3. Drag and drop the desired fields into the corresponding cells in the data table.

    7. Format the Tables:

      1. Adjust column widths and text alignment as needed to ensure the data displays correctly.

      2. Apply any desired styling to match your organization's branding.

    8. Save and Upload the Template:

      1. Save your letter template.

      2. Upload the updated template to the appropriate letter profile in ACE.

    Note: By configuring the headers and the data into two tables, you prevent issues where the headers might repeat for each data row. ACE will loop over the data table and insert as many rows as needed based on the data retrieved, while the header table remains static at the top.

    Letter Loop Demonstration with GIF Example

    To further illustrate the process, a GIF demonstrates adding the debt_trans_owing_loop to a letter template:

    • First Table (Header):

      • The GIF shows creating the first table with one row for headers.

      • The table properties are left without a name, ensuring it remains static.

      • Headers such as "Date," "Description," and "Amount" are added.

    • Second Table (Data Table with Loop):

      • Below the header table, a second table is inserted with matching columns.

      • This table is intended for the data that will populate dynamically.

      • The table properties are accessed, and the Name is set to debt_trans_owing_loop.

      • Data fields corresponding to the headers are inserted into this table by dragging them from the data sources.

    By following the steps shown in the GIF, you can visually understand how to set up loops in your letter templates effectively.

    Tips and Best Practices

    • Separate Headers and Data: Use one table for headers and a separate table for data. This prevents the headers from repeating with each data row.

    • Always Use Correct Loop Names: Ensure the data table's name exactly matches the loop identifier. Incorrect names will result in the loop not functioning.

    • Include Headers: Adding headers in the first table helps clarify the data presented in the loop.

    • Keep Templates Updated: If you make changes to the loop or the data fields, remember to update your template and re-upload it to ACE.

    • Test Your Templates: Before using the letter template broadly, always test it with sample data first to confirm that the loops are working correctly.


    Was this article helpful?

    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.
    ESC

    Eddy AI, facilitating knowledge discovery through conversational intelligence