Automating Daily Reports
In this episode of Build It With Tim, we're diving into the process of sending daily PDF reports for open projects using scheduled tasks and PDF pages. The goal here is to automate the process of generating a PDF report for each project that currently has open tasks and then emailing it to the respective project manager. Let's break down the steps to achieve this.
Firstly, within the Tadabase Database Builder, you need to create the PDF report you want to send. Under the Automation tab, navigate to PDF Pages and create a new PDF page. Choose the Detail view type to display one record from the projects data table along with connected tasks, expenses, and notes. Customize this page by adding components displaying relevant project information, open tasks, expenses, and notes.
Next, you'll configure scheduled tasks to automate the process. In the Data Builder, add an attachments field to store the generated PDF reports. Then, create two scheduled tasks. The first task, named "Create PDF," runs daily at 9 a.m. and creates the PDF report for projects with open tasks. Set a condition to create the PDF only if the number of open tasks is greater than zero. Save the generated PDF to the attachments field.
The second task, "Send Daily Report," runs at 9:30 a.m. daily. It checks projects with open tasks and sends an email to the project manager. Set the same condition as before and configure the email details such as recipient, sender, subject, and message content. Attach the PDF from the attachments field to the email.
To summarize, the workflow involves checking projects for open tasks, generating a PDF report using PDF Pages, saving it to a record through scheduled tasks, and then emailing it to the respective project manager. By automating this process, you ensure that project managers receive daily updates on their open projects without manual intervention.
That's it for today's episode of Build It With Tim. We hope this guide helps you automate your PDF reporting process effectively. If you have any further questions or need assistance, feel free to reach out. Happy automating!
Features Discussed:
-
PDF Pages (Time: 1:15)
Learn how to create a PDF report using the PDF Pages feature. -
Scheduled Tasks (Time: 3:59)
Learn how to use Scheduled Tasks to generate and email daily reports.
Transcript Summary
Introduction
Hey everybody, this is Build It with Tadabase. On today's episode, we're going to learn how to send daily PDF reports using scheduled tasks and PDF pages. In the past, I've done some videos on automating your email notifications, and in general, this is a similar system except we're including PDF pages and some additional logic.
Overview of the Task
We want to send a PDF report for each project that is currently open every single day. The status of open or not open is determined by a count field or a formula field that checks the number of open tasks. If the condition is met—meaning if open tasks are greater than zero—we want to send a PDF report to the project manager containing information about that particular project, including project notes, expenses, and tasks.
Creating the PDF Report
The first thing we need to do is create the PDF or report that we want to send. Head to the automation tab and under PDF Pages, add a new PDF page. Give it a name like "Daily Report," and choose a view type for the data you wish to display. There are two options available: list and detail.
- List shows all records from a particular data table.
- Detail shows one record from a data table and allows viewing connected or related information.
Since we want to send a report based on a single project and display connected tasks, expenses, and notes, we're going to choose the detail type.
Next, define the data table you want to process the PDF for, which in this case is "Projects." From here, you can start building out the page just like you would inside the page builder.
- Add a new row, column, and component, and start by adding a detail component about the particular project you are sending the report for.
- Add fields like project title, project description, and project manager.
- In the next column, add total expenses, the number of open tasks, and the priority.
Below this, start adding all of the connected information:
- Use the table component to display a list of tasks with the task name, description, progress, priority, deadline, and assigned person.
- Filter this to show only tasks where the status or progress is not "done."
- Repeat this process for expenses connected to the project and for notes.
You can preview the PDF by clicking the "Download Preview" button in the bottom right corner. This will generate a preview based on a record inside your data table. If everything looks good, you can move on to the next stage.
Setting Up Scheduled Tasks
We'll use scheduled tasks to generate this PDF at a specified frequency, and part of that process includes saving the generated PDF back to the data table.
Adding an Attachments Field
Before adding the scheduled task, go back to your data builder, into the projects table, and add an attachments field to store the daily report.
Creating the Scheduled Task
Now, go to the automation tab and create your task. Like with the PDF, define what data table your task will run on, which records it will process—in our case, "Projects."
- Schedule: Set it to run daily at 9:00 AM.
- Task Action: From the drop-down of available actions, choose "Create PDF."
Add a condition because you only want to send this report when a project actually has open tasks:
- Click "Add Condition" and use the field that counts the number of tasks that are open as your condition.
- Set the condition to only create the PDF when the number of open tasks is higher than zero.
Configure the creation of the PDF page:
- Select the "Daily Report" PDF you created earlier.
- Select the "Daily Report Attachments" field you created earlier.
- Choose whether you want to append the PDF into the attachments field or overwrite it. For this example, choose "Overwrite."
Save this task.
Sending the Report via Email
When the task runs, it will generate a PDF and save it. However, we now need another task to email it to the project manager.
Creating the Email Task
Head back to the automation tab to create a second scheduled task called "Send Daily Report."
- Data Table: Choose "Projects" since this is where the project manager field lives.
- Schedule: Set it to run daily, but stagger the time slightly to give the system time to process all the PDFs. Send the email 30 minutes later, at 9:30 AM.
- Task Action: Choose "Send Email."
The condition will be the same: only send the PDF in an email when the number of tasks is higher than zero.
Configure the email:
- Send to the project manager's email field value.
- Fill out the "From" name, email, and subject (e.g., "Daily Report for Project" including the project title).
- In the message, you can add relevant fields like "Good morning [Project Manager]," and describe what the email is for (e.g., "Project [Title] currently has [X] open tasks. Your daily report is attached.").
Attach the PDF by selecting the daily report attachments field where the PDF is saved. Save the task to complete the workflow.
Conclusion
Let's quickly recap: Within our data builder, we have a projects data table storing information on projects we're currently working on, connected to project notes, expenses, and tasks. Every day, we check whether a project has open tasks, generate a PDF report, and email it to the project manager. We created our PDF report through Automation and PDF Pages, and we're using two scheduled tasks—one to create and save the daily report, and another to email it 30 minutes later.
We'd love to hear your feedback.