Why is my rule running twice? (Is my custom formula field recalculating twice?)

I have two date fields in a “cancellations” project that I’m setting up.

  1. Service Ending Date
  2. Next Payment Date

If the next payment date is before the service ending date, then one more payment needs to run before we cancel billing, but if the next payment date is after the service ending date, then we can cancel billing immediately.

I set up a custom formula field in my project, which subtracts (Next Payment Date) minus (Service Ending Date).

I also set up a rule, based on the value in the “Custom Formula” field, that’s constructed like this:

WHEN the “Custom Formula field is changed”

CHECK IF the custom formula is a negative number.

-If the value is negative, create a reminder to “Cancel billing later.”
-Otherwise, create a subtask to “Cancel billing now.”

Tasks are added to the project via a form submission only.

In testing this, the rule for “when to cancel billing” keeps running twice, so it adds two subtasks. I’m not sure why it’s running twice or how to stop it from doing that.

When the form is submitted, both date fields are filled out, as both are required fields. My hypothesis is that maybe Asana is pulling from the form and updating the two date fields one at a time rather than simultaneously, and thus, the “custom formula” field changes twice (it has one value when the first date is added, and it has another value when the second date is added). In the “All Activity” view, I can see that the rule says it ran twice and added the subtask twice.

I can’t find another option for triggering a rule based the “Bill runs before cancellation?” field other than “when value is changed.”

Is there a way to get around this? Is there something else I’m doing wrong?

Hi @Rebekah_Chalkley

I could reproduce it on my end, and I can’t understand the reason.
But I found a workaround.
Please try the following rule. I changed the trigger.

Work around worked for me too

Thank you both! I set the trigger that way, and it worked for me. I really appreciate your help!

As a note, I also found that the following variation on the rules worked better. I was still getting errors (but at least the rule stopped running twice) when I had it set up to check the value of my custom formula field (“Bill runs before cancellation?”). It was always taking the path to “cancel billing now,” even on tasks where it should have taken the “cancel billing later” path.

I switched the “Conditions” to have AI assess the two date fields directly, rather than referencing the “Bill runs before cancellation?” field. Now it’s adding the correct subtasks.

I’m glad to hear that you’ve got another solution. But the behaviour is weird. In my end, the rule routes tasks correctly.

How does your “Bill runs before cancellation” field return a number rather than a date? Mine is returning something like “1w 3d” or “-1w 3d.”

Because the field wasn’t returning an “integer-style” number, it also made it so that I had more limited options for actions with that field.

I’d love to be able to remove the AI-based rule and just use one that’s more like yours.

Hi @Rebekah_Chalkley

There is a trick to make formula fields the number format.
Now you need to create a new ‘Bill runs before cancellation’.
Formula fields allow us to change the formatting only during initial setup.
Please try the following:

  1. Set the formula ‘Next Payment Date - Service Ending Day +0’ with ‘Advanced editor’
  2. Set the formatting to ‘Number’

This following post would help you.

Ok this is SPLENDID. You are incredible and I am stoked with my new knowledge! I just tested that and it works. I really appreciate your help!

I also hadn’t run into that link you referenced, so I’m about to go study that.

THANK YOU!

Hi @Rebekah_Chalkley , glad you found this resource useful (thanks, @Tetsuo_Kawakami for referencing it)

Regarding that post, note it was posted when the Advanced formula editor was just released in 2023. Since then you can use the (more recently added) Formatting tab to set the decimals as well as custom labels (such as ‘d’ for days) or currencies.

The trick is to set the format to a number BEFORE you save/create the formula for the very the first time.