Marketo Form Field Calculation | Community
Skip to main content
New Participant
May 8, 2024
Solved

Marketo Form Field Calculation

  • May 8, 2024
  • 2 replies
  • 1901 views

Hi all,

 

I was hoping someone could assist me with a forms-related query.

 

I am trying to create a form with the ability to display simple calculation of previous form field selections.

 

Simply put, within the form:

 

- Field A (Product Price) currently as a currency field

- Field B (Product Quantity) currently as a integer field

 

I would like to have a Field C that follows, which will automatically calculate Field A x Field B.

 

I have looked into Formula fields, however I am unsure if they are applicable to my ask and have been unable to use them within the form.

 

Any assistance would be greatly appreciated!

Best answer by Michael_Florin-2

If you really need to write the result of your mathematical operation into a Marketo field, you can't do this with Marketo alone. You will need to bring in an external service that does the calculation for you. You could look at https://flowboo.st/ or check out Marketo's Self-Service Flow Step and use the Adobe Runtime I/O: https://experienceleague.adobe.com/en/docs/marketo/using/product-docs/core-marketo-concepts/smart-campaigns/flow-actions/flow-step-service

If you need the output of your calculation only on an email, you can do this via Email Script Token. Velocity - its language - can do math. https://experienceleague.adobe.com/en/docs/marketo/using/product-docs/email-marketing/general/using-tokens/create-an-email-script-token

2 replies

SanfordWhiteman
New Participant
May 8, 2024

To be clear, if you’re talking about all 3 fields being on the form — much as I appreciate Michael’s mention of FlowBoost! — there’s no need to use anything on the server side.

 

Field C can be automatically populated with Field A * Field B whenever A or B changes, then A, B, and C can be stored in Marketo.

 

Here’s a demo form I put together for an earlier thread showing a similar real-time calculation:

MktoForms2 :: Total Numeric Fields

 

Of course if C is always the product of A and B it’s a bit of a waste to store C when (as Michael also mentioned) you can calculate it dynamically whenever you need to output it: use Velocity $math.mul() in emails or JS on LPs.

Michael_Florin-2
Michael_Florin-2Accepted solution
New Participant
May 8, 2024

If you really need to write the result of your mathematical operation into a Marketo field, you can't do this with Marketo alone. You will need to bring in an external service that does the calculation for you. You could look at https://flowboo.st/ or check out Marketo's Self-Service Flow Step and use the Adobe Runtime I/O: https://experienceleague.adobe.com/en/docs/marketo/using/product-docs/core-marketo-concepts/smart-campaigns/flow-actions/flow-step-service

If you need the output of your calculation only on an email, you can do this via Email Script Token. Velocity - its language - can do math. https://experienceleague.adobe.com/en/docs/marketo/using/product-docs/email-marketing/general/using-tokens/create-an-email-script-token