How to Create a Recurring Task Creator in InfoLobby
Introduction
InfoLobby already has an amazing task feature where you can create tasks, assign them to someone, and track their completion. You can also create tasks from items within InfoLobby. But what if you need tasks created automatically? This guide will show you how to build a recurring task creator in InfoLobby.
Creating a Schedule Table for the Recurring Tasks
Start by creating a dedicated space in InfoLobby and call it something relevant to your tasks, such as "Recurring Tasks." Within the recurring tasks space, create a table to store your recurring tasks. Add the following fields to your table:
- Title: This will be the title of the task.
- Details: This is a text area where you can provide more information about the task.
- Frequency: This is a select field where you can choose how often the task should be created (daily, weekly, biweekly, monthly, quarterly, or half yearly).
- Next Due Date: This is a date field that shows the next time the task will be created.
- User: This is a user field where you can assign the task to a specific user.
Automating Task Creation
Now, we need to create an automation to automatically create the tasks based on the schedule we created. Call the automation something like "Create Recurring Tasks."
Create New Automation Flow
- Go to Table Settings > Automation > Create New Flow.
- Set the trigger of the automation to "By a Record's Date Field".
Set the Condition
- In the IF section, choose Next Due Date as the conditional date field.
- Leave the other values as is. Choose a suitable time from the At Time option (e.g., 13:25 for 1:25 PM).
Create Task Action
- In the THEN section, add the Create Task action block.
- Fill in the task details. Type
@
to get a list of variable tokens and choose the record's fields as the task's fields.
Calculate Next Due Date
- Add a Calculate Variable block in the
THEN
section. Call itnew_date
. - Use the following PHP function to calculate the next due date:
-
$current_date = @{current:next-due-time}; $frequency = @{current:frequency}; function calculateNextDate($current_date,$frequency) { $current_date = strtotime($current_date); $next_date = $current_date; if (strtolower($frequency) == 'daily') { $next_date = strtotime('+1 day', $current_date); } else if (strtolower($frequency) == 'weekly') { $next_date = strtotime('+1 week', $current_date); } else if (strtolower($frequency) == 'bi-weekly') { $next_date = strtotime('+2 weeks', $current_date); } else if (strtolower($frequency) == 'monthly') { $next_date = strtotime('+1 month', $current_date); } else if (strtolower($frequency) == 'quarterly') { $next_date = strtotime('+3 months', $current_date); } else if (strtolower($frequency) == 'half-yearly') { $next_date = strtotime('+6 months', $current_date); } else if (strtolower($frequency) == 'yearly') { $next_date = strtotime('+1 year', $current_date); } else { $next_date = $current_date; } return date('Y-m-d',$next_date) } $next_date = calculateNextDate($current_date,$frequency); return next_date;
Update Next Due Date
- Add an Update Record action block in the
THEN
section. - Choose the current record to update and only add the "Next Due Date" field to update.
- Set the value to the result of the "
new_date
" variable.
Save the Automation:
- Save your automation.
- Now your recurring task creator is ready. Go to the schedule and create a task. For example:
-
- Title: Create Twitter Post
- Frequency: Daily
- Next Due Date: Tomorrow's date
- User: Select a user to be assigned.
- So tomorrow at 00:25 (or another time that you have chosen in your automation IF statement), a task will be created for this entry. Additionally, the "Next Due Date" field in the schedule will be updated to the day after tomorrow.
Conclusion
By following these steps, you can create a recurring task creator in InfoLobby that will automatically create tasks for you based on your schedule. This can be a great way to save time and ensure that you never miss an important task.