Guide

Our favorite Workflow Automation functions

  • 14 October 2021
  • 13 replies
  • 1541 views
Our  favorite Workflow Automation functions
Userlevel 7
Badge +7

If you’ve used Workflow Automation, you’ve probably seen that you can customize them using formulas. Here we’re going to walk through the most common formulas and how to use them, including:

 

This article is meant to be a quick reference sheet. For a full comprehensive list of formulas, check out this article here.

 

 

1. CURRENTDATE()

 

What does it do?

This function returns the date that your automation was triggered. So if your Workflow Automation is triggered on October 14th 2021, this function will return 2021-10-14.

Please note that nothing goes in the brackets; you can simply copy and paste this formula into your workflow automation: CURRENTDATE()

 

How do I use it?

A common way to use this function is to populate a date field. For example, if your Workflow Automation creates a Task, you can use this function to set that Task’s due date to the same day it was created.

You can also use CURRENDATE() in combination with other functions such as DATEADD().

 

 

2. DATEADD(x,y)

 

What does it do?

This function takes a date (x) and adds some number of days to it (y). For example, to add 10 days to an Opportunity’s Close Date, you would use DATEADD(close_date,10) . 

This function can also be used to subtract days. Simply make the number negative: DATEADD(close_date,-10) 

 

How do I use it?

This function is commonly used to populate a date field such as a Due Date or Close Date.

It’s very common to pair this function with CURRENTDATE() ; this allows you to add some number of days to the current date!

For example, if you want to create a Task that is due ten days from now (or rather, from when the workflow automation is triggered), you can use this formula: DATEADD(CURRENTDATE(),10)

 

 

3. Mathematical Operators (+, -,  * and /)

 

What does it do?

These are mathematical operators just like in a calculator.

  • +  and -  add and subtract, respectively
  • *  and /  multiply and divide, respectively

This enables us to do calculations on our fields in Copper. You can combine several of these functions into a single formula if you need to do multiple additions, subtractions, etc. And you can use brackets to ensure they operators are applied in the correct order. For example, (1+2)*3 will return 9.

 

How do I use it?

A common way to use these is for calculating commission. Let’s say for example we have some sales reps who earn 5% commission on an Opportunity. In the workflow automation, you would set your formula to: monetary_value*0.05

If your commission rate varies, you can build a custom field to store that percentage. Just remember that percentages are stored as integers (e.g. 5% is equal to 5, not 0.05) so remember to divide by 100: monetary_value*cf_commission_rate/100

 

Click here for our full Workflow Automation Recipe for calculating commission.

 

 

4. CONCAT (x,y)

 

What does it do?

This function takes two or more pieces of text and combines them into one.

 

How do I use it?

This function is commonly used for naming Tasks or Opportunities. For example, you might have a workflow automation that sets a Task to draft a contact. Using this function, you can set the name of the Task to include the name of the Opportunity: CONCAT(‘Draft contract for: ‘,name)

In this example, if my workflow automation is triggered off an Opportunity called Consulting Package - AWG Co then the resulting Task will be called Draft contract for: Consulting Package - AWG Co.

 

 

These are just a few of the most common formulas. We have tons more you can learn about here. And if you have any questions, feel free to post them in the Community!


13 replies

Userlevel 1
Badge

Is there a formula that allows you to assign the task on the next Monday?

Userlevel 7
Badge +7

Hi @ARCO, thanks for commenting! We do not currently have any functions that works off of weekdays. The closest one would be the DAYS() function, which can only work off the the number of calendar days.

I can see how that would be useful though. Please feel free to post it as an Idea for our Product team to look at. Thanks ARCO!

Is there a formula that will assign a task to the current owner of the page?

I just want to trigger an auto email as it moves into our different pipeline and lead areas and I am lost

 

Userlevel 7
Badge +7

@AnnieKeller_SP 

Sounds like you are creating a task based on some change in an opportunity, contact or company - is that right?

In that case, yes, the resulting Task can be assigned to the owner of the opportunity/contact/company. I will put an example below where we are creating a new Task every time an Opportunity is marked as Won.

Under the action, notice that the Owner is set to Use a Formula - assignee_id. This assigns the Task to whoever owned the Opportunity that was Won.

Userlevel 7
Badge +7

I just want to trigger an auto email as it moves into our different pipeline and lead areas and I am lost

 

@DerrickFlynn 

It sounds like you want to get notified each time there’s a change. For Pipelines, you can click the star icon - this lets you “follow” it and you’ll receive an email each time it moves Pipeline stages.

You can also set up rules for auto-following by going to Settings > Personal Preferences > Notifications. At the bottom of the page there’s a section for “Automatically follow records when:” and you can select your criteria.

For other notifications, you have some options for setting that up:

  1. Set up a Zapier automation that sends those emails, or
  2. Set up Copper workflow automation rule that creates a Task every time something moves into a different Pipeline stage or Lead Status. The resulting Task would send an email.

I see that RJ is helping you with the Zapier option.

Userlevel 1

Is it possible to add years as well as days to DATEADD() function?

Userlevel 7
Badge +7

Hi @Drive Zone! We don't have a specific function for adding years, so I recommend using the DATEADD() function but adjusting the number of days accordingly. For example, to add 1 year, I would do DATEADD(CURRENTDATE(),365). With this method, your dates may end up a day off depending on leap years, but it should land you pretty close.

Hope that helps! 

Userlevel 1
Badge

Is there a list of all of the function options?

Userlevel 7
Badge +7

Hi @ARCO! The full list is in this help article, under the section “What functions can be used with Workflow Automation?”

Let us know if you ever need help with which ones to use and how :)

Hello Copper. I had a question and was having a tough time solving. I’m trying to automate tasks to be created as opportunities exceed their time in a stage.

I have opportunities going through a pipeline (Via stages) like A, B, C; and they should stay in each stage for 3, 4, and 5 days. What formula can i use for creating a task for the opportunity owner, if the days in that stage exceed the days above? Thank you very much!

Userlevel 7
Badge +7

Hi @prozaro! Here’s an example of what you're trying to build:

 

This trigger says: every day, check every Opportunity. If we find an Opportunity that is in the New Sales Pipeline, in the Stage “Initial Consultation,” and its Days in Stage is 3, do the Action.

(For context, Days in Stage is exactly what it sounds like - the number of days an Opp has spent in its current stage.)

When you set up this trigger, please make sure you select the “Check Once a day” option at the top. And for Days in Stage, make sure you select “Equals” and not “Greater than” so that it creates the Task only once, and not again the next day.

 

And here’s the action. It creates a task called “Warning: Opp stuck in stage.” That due date is set to tomorrow using the formula DATEAD(CURRENTDATE(),1), and we’re assigning it to the Owner of the Opportunity.

 

You mentioned you want different “Days in stage” thresholds for different stages. You can do that, but you’ll need to set up a separate workflow automation rule for each one.

Let me know if that helps!

Good day! I would like to build an automation that will create a new opportunity for any current customers. If I create the trigger to start a new opportunity based on Inactive days and that it check once a day I cannot see how to have it only apply to current customers. Additionally it would only create if an opportunity is not already open for that customer (potentially across multiple pipelines).

Ideas?

Reply