Marketo: Displaying Excel-Based Field Values in Emails & Calculating Revenue via Script | Community
Skip to main content
Level 4
March 18, 2026
Question

Marketo: Displaying Excel-Based Field Values in Emails & Calculating Revenue via Script

  • March 18, 2026
  • 1 reply
  • 13 views

Hi Team,

We have a requirement where a field is currently not available in our CRM as a temporary solution which will be fixed in long term. To support this, we will be receiving an Excel file containing Marketo ID, dollar amount, and revenue for each record. The goal is to use this data within our emails.

I’d like to better understand the feasible approach here, as we want to avoid creating new records and instead leverage existing ones and update them. 

Specifically, I have two questions:

  1. Displaying Excel-based values in emails
    Is it possible to take values such as dollar amount directly from the Excel file and display them in an email? If so, what would be the recommended approach?

  2. Applying calculations (e.g., 10% of revenue)
    We also need to display a calculated value—specifically, 10% of the revenue provided in the file (e.g., if revenue is 5,000, the email should display 500). Is there a way to handle this dynamically within Marketo, or would this need to be pre-calculated before import?

However, I’d appreciate confirmation on the recommended approach for displaying values from an Excel file in Marketo, including how this should be implemented. Additionally, I’d like to understand how we can calculate a derived value (e.g., a percentage of revenue) using a script once the data is available in Marketo—potentially via a custom field.

Thanks in advance for your guidance.

1 reply

SanfordWhiteman
Level 10
March 18, 2026

You cannot read data that isn’t stored in Marketo in some way, be that a Person field, Program Member field, or Custom Object. There’s no such thing as a fully external data source that just gets brought into Marketo using (for example) a remote HTTP call but is never stored anywhere.

 

If you want to treat both data and its underlying definition/schema as non-permanent, the easiest way is a Custom Object. This is because COs definitions + data can be completely destroyed when you don’t need to use them anymore. So bulk CO upload would be the best “temporary” choice.

 

You can do the calculation you describe using a Velocity {{my.token}}. That part is easy and doesn’t depend on how you store the data. It could be in a Person, Member or CO field.

ashah123Author
Level 4
March 18, 2026

@SanfordWhiteman 

Thanks for sharing the feedback. I haven’t created a CO before, so I’m not fully familiar with that approach, but I’m open to learning and giving it a try if needed.

Another thing, I wanted to run by you. Would it make sense to create a custom field in Marketo and map a unique identifier from the Excel file to existing records? That way, we could update the custom field with the corresponding value from Excel instead of creating new leads. This would allow us to store the data directly in Marketo and reference it in the email for dynamic display. Let me know if you see any concerns with this approach.

Secondly, do you happen to have a sample Velocity script for calculating and displaying the percentage value? My thought is to store the value in a custom field and then use Velocity to compute and render the percentage amount dynamically in the email. If you could share an example script, that would be really helpful for testing.

SanfordWhiteman
Level 10
March 18, 2026

You can create a new custom field, sure. But I thought you were trying for a disposable approach, and a custom field can’t be deleted like a CO.

 

Calculating 10% in VTL:

#set( $tenPercent = $number.integer( $math.mul( $math.div($lead.field,100), 10 ) ) )
10% is ${tenPercent}

Note this uses banker’s rounding (which only matters if you have revenue values like 5005 as opposed to 5000). If you need arithmetic rounding, look up my blog post on that.