How Can I Debug Formulas?

How Can I Debug Formulas?


You can use debug mode to understand how formulas are applied to a sample transaction or sample payee. You will see how each formula statement was evaluated against your sample transaction or user (payee).

Debugging Formulas - Sample Transaction
To enable transaction debugging:
  1. Select "Transactions > All Transactions"
  2. Find your transaction
  3. Click on the transaction
  4. Copy everything after the last slash from the URL



Other ways to find transaction IDs: 
  • Open your transaction and click on the "Metadata" tab > System ID
  • Export credits from a calculation > System ID

Next, edit your plan to enable debugging:
  1. Edit your plan
  2. Go to the "Calculations" tab (if needed)
  3. Paste your transaction ID to the "Debug Record ID" field 
  4. Save your plan

Next, re-run your calculation. When you open your calculation, you should see a "Debug" tab with evaluation details. If you do not see a Debug tab, this means that your transaction wasn't processed by the calculation (ex: its date is outside your calculation's range, or does not match your plan's filter).



Debugging Formulas - Sample Payee
To enable user debugging:
  1. Select "Users > All Users"
  2. Find your user
  3. Click on the user
  4. Copy everything after the last slash from the URL




Next, edit your plan to enable debugging:
  1. Edit your plan
  2. Go to the "Calculations" tab (if needed)
  3. Paste your user ID to the "Debug Record ID" field 
  4. Save your plan

Next, re-run your calculation. When you open your calculation, you should see a "Debug" tab with evaluation details. If you do not see a Debug tab, this means that no reward formula was activated with this user as a payee (ex: this payee was not eligible for a payout).



Debugging Formulas - Log Statement
Finally, you can log specific statements using the Log() function.

In the example below, logging only occurs if revenue is over 1000. Due to parallel processing, log statements may be intermixed, and therefore should provide sufficient context.



    • Related Articles

    • What Are Commission Formulas For?

      If you are using spreadsheets to calculate commissions, you are probably: Use messy nested conditions Reference cells by name or position Have multiple sheets with v-tables, etc. If someone shifts cells, adds a column, or includes hidden rows of ...
    • Error - Your Plan Contains Advanced Formulas Which Must Be Approved By Us

      Applicability This error applies to the following situation: A plan was configured by our technical team You altered formulas within the plan Some of those formulas contain {{...}} expressions Your calculation is failing with this error Impact This ...
    • How Do I Record Professional Services?

      This KB only applies to authorized Sales Cookie operators. To record delivered professional services, follow these steps: Go to Debug > Impersonate Login to the customer's account Go to Debug > Log Service Complete the form Service Type = type of ...
    • Is There A Complete Formula Technical Reference?

      This article provides technical details about formulas. For some background information about formulas, click here. You can configure formulas to control different aspects of calculations, such as filtering, crediting, scoring, quota, custom, ...
    • How Can I Embed "Slugs" In Announcements, Legal, Etc.

      Define Custom Variables Edit your user and click on the "Custom" tab. Add custom variables for this user. Note that the same variable can be defined multiple times (with different values and effective dates). Embed Custom Variable "Slugs" Edit your ...