Creating Nested Dynamic Tables Using Variable Relationships in Perfect Doc Studio

Creating Nested Dynamic Tables Using Variable Relationships in Perfect Doc Studio

In Perfect Doc Studio, you can create Nested Dynamic Tables by establishing relationships between two entities in the variables section. This setup allows the variables of one entity to be linked with those of another, enabling tables to dynamically expand based on their data relationships.


What are Nested Dynamic Tables?

Nested Dynamic Tables are tables that automatically expand based on the relationships between variables from different entities. Instead of manually adding rows or columns, the system uses these linked variables to generate data dynamically.

Example: If a Customer entity is related to an Orders entity, each customer’s table will automatically display all their related orders, adding new columns or rows as needed.

So, a Nested Dynamic Table represents a logical relationship between variables, where one entity acts as the parent and the other as the child:

Parent Entity: The main dataset driving the table (e.g., Customer).

Child Entity: The related dataset that expands dynamically based on the parent (e.g., Orders).

How to Add a Relationship to an Entity

1. You can add a relationship to an existing entity or create a new entity and link it with another existing one. 
2. Select the entity to which you want to add the relationship and click on it. 



3. Click the Add New Relationship button. 



4. A modal window will appear where you can select the related entity and relationship type. 



5. From the dropdown, choose one of the available entities to establish the link. 



6. Next, choose the relationship type Has One or Has Many: 

Has One – Used when one record from the parent entity is linked to only one record in the related entity
Example: A Customer has one Address, each customer is connected to a single address record.

Has Many – Used when one record from the parent entity is linked to multiple records in the related entity
Example: A Customer has many Orders, each customer can have several related order records.



7. Once selected, the entities will be linked to each other. 




How to Create a Nested Table Using Variable Relationships

1. Drag and drop a Dynamic Table into your document design.


2. Add columns as per your requirement. 


3. In the first column, add the parent entity, i.e., the entity where the relationship was created. In this case, it is Customer, so let’s add Customer.Name.



4. In the second column, after typing the dollar symbol ($), enter the parent entity name (Customer). A list of variables under this entity will appear, scroll down to the bottom to find the related entity “Order.”



5. Once you select Order, the variables under it will appear. Choose one of them as needed. 


6. You can also link another entity under Order, in that case, Order becomes the new parent entity. 


7. Now, navigate to the Preview and Download section.


8. Here, you can input data into your variables and add rows as needed, the table will automatically expand dynamically based on the relationships. 


9. In this example, we have the Customer.Name variable linked to the Order entity. 


10. Clicking the Add Row button will insert additional vertical rows into the Dynamic Table.



11. Select Row 1 to add rows inside the Dynamic Table for the Order.Name variable.


12. Click the Add Row button again to insert more rows as needed. 



13. After entering the values, the nested table will appear as shown below. 



Scenarios Where Nested Dynamic Tables Are Useful:

Nested dynamic tables are ideal for situations where a parent entity has multiple related child records. For instance, they can be used to generate customer statements with all transactions, insurance policies showing multiple coverages and claims, vendor catalogs listing all products, or employee performance reports with monthly metrics. This approach saves time and ensures documents are accurate, organized, and fully data-driven.


    • Related Articles

    • Adding Dynamically populated Tables

      Dynamic tables serve as interactive components within documents, dynamically altering their content in response to user interactions or modifications in data. Widely employed across various domains including data management systems, financial ...
    • Styling Dynamic Tables

      Dynamic tables offer users the flexibility to tailor the table's aesthetics according to their unique preferences. This customization capability extends to various aspects of the table, including the grid, rows, cells, and the option to specifically ...
    • How to make your Document Truly Accessible using Perfect Doc Studio?

      Before making a document accessible, users must first enable the Accessibility option in the Document Settings section. Without enabling this option, the accessible design features will not be available. Once enabled, users can make their documents ...
    • How to Create a Fillable Document in Perfect Doc Studio

      Perfect Doc Studio makes creating fillable documents simple and efficient. With features like signature fields, checkboxes, and other interactive form elements, you can design professional, user-friendly forms that are easy to complete digitally. ...
    • Master Elements - What are they and How to use?

      Master elements in Perfect Doc Studio are pre-designed elements that can be used as building blocks for creating custom templates for various types of communications, including documents and emails. These elements are provided out of the box to help ...