←

EmotionTrac / Workflow automation

Reconcile billing with the finished test.

An order can change between intake and delivery. I built a reusable billing step so the opportunity reflects what the team delivered, including extras beyond the package allowance.

Trigger

The Test Complete workflow passes the Salesforce opportunity ID, test type, question count, video duration, survey IDs, and audience information to this sub-workflow.

Action

  1. Calculate the billable extras

    Python compares the final question count and video duration with the allowances for the test package. Only the excess becomes an add-on quantity. Missing counts or unusable video information produce a message for the team.

  2. Reconcile the survey costs

    Using the survey IDs, the workflow retrieves the number of completed interviews. For a custom audience, it also reads Cint finance data and calculates the custom-audience line item from those costs.

  3. Update the opportunity products

    The workflow looks up the affected Salesforce line items, removes obsolete entries in those product categories, and adds the quantities and costs it calculated. It returns a summary to the completion workflow for the team’s delivery update.

Example calculationStandard litigation package
Questions in the completed test
8
Questions included in this package
6
Additional questions on the opportunity
2

Impact

Billing can use the quantities and audience costs from the completed test. Client Success spends less time comparing the original order with the final survey and manually correcting the opportunity before billing.