Skip to main content
All CollectionsSwantide Workflows
Create Task(s) X Days Out from a Date Field on an Opportunity Record
Create Task(s) X Days Out from a Date Field on an Opportunity Record
Engineering Swantide avatar
Written by Engineering Swantide
Updated this week

Overview

This Swantide Workflow automates task creation for Opportunities when a date field on the Opportunity is reaching a specific time frame based on the number of days you enter. It is designed to automate the creation of tasks based on an approaching date field on the Opportunity.

This flow is set to run daily at 12:30 AM to check if the date field is met within X days out from the Variable Input you enter in.

Additionally, if the date field happens to change and the initial tasks have already been created, you can type in "Yes" or "No" to recreate the tasks if the record's date field you selected is met again. We recommend to type "No" but everyone's processes can defer.

Variable Inputs:

Select the Date Field in scope.

  • Select the Date Field in which you would like the flow to check if an Opportunity Record is approaching X days from today.

  • Example would be Close Date

Specify the number of days before the selected Date Field when the flow should check if the Opportunity is approaching.

  • This is the number of days we are looking back from the Date field you select to see if the Opportunity record is in scope to create tasks. For example, type "30" to see if the Opportunity Close Date is approaching 30 days from the date in which the flow is triggered at run time.

  • For Example, if the Close Date of the Opportunity is January 17, 2025 and the flows runs on December 18, 2024 then Tasks will be created.

Select additional criteria for the flow's starting conditions that the record must meet.

  • Add additional criteria to the Flow's entry criteria to refine when this scheduled flow should be triggered. We already included IsClosed = False so that it only looks at Open Opportunities. A recommendation is to add an Opportunity Type like "New Business" or "Renewal" so its more prescriptive. Note that the operator used is an AND condition, meaning all conditions must be met. If you include an Opportunity Type, select just one type to ensure the criteria are met effectively.

Type out the Subject you want the Task to be Assigned (Hit Save to Enter the Next Subject)

  • These will be the unique subject names you will apply to the subject of the Task, such as "Generate Quote", "Confirm Budget", etc

How many days out should the task be due once it created? Ex: Type 2 for 2 Days Out.

  • This will be setting the date in which the Tasks are due once created.

If the Date Field changes and the record meets the conditions again, should the tasks be recreated? Type "Yes" or "No."

  • Allows you to set if you would like these task to be recreated in the event that the Date Field you selected is changed and the Opportunity Record falls in scope of the Date Field approaching again. The default value is set to "No" to avoid recreating tasks that have already been created, as this could be redundant.

This workflow is also set to allow multiple deployments. If you want to deploy this workflow with the same date field but on a different Opportunity Type for example, ensure that the number value you enter under the variable "Specify the number of days before the selected Date Field when the flow should check if the Opportunity is approaching." is unique as it will deploy the flow based on the following API Name syntax which should be unique across all instances.

Swantide_Create_Task_Oppty_VARXDAYS_DaysBefore_VARDATEFIELD.

Which VARXDAYS is the number of days you entered and VARDATEFIELD is the date field you selected on the Opportunity Object.

So if you entered "30" as the number of days and "Opportunity.CloseDate" as the date field, the flow API Name will be "Swantide_Create_Task_Oppty_30_DaysBefore_CloseDate"

Example Variable Input on this Workflow:

How this will work in Salesforce:

Here I have an Opportunity record that is of Type "New Customer" based on my variable inputs.

On a daily basis at 12:30 AM, the automation will run in the background to check if Opportunity Records are approaching 30 days from the Opportunity Close Date.

Opportunity Close Date and 30 days are just an example used as the Date Field I selected and the number of days I entered to look back from the Date Field I selected, respectfully.

When the scheduled flow is triggered, you can now see that 3 tasks were created. 3 tasks were created as I typed out 3 different Subject items as my Variable Input.


Did this answer your question?