Skip to main content

How to Get the Highest Value from a Quote Product Field

How to create a JavaScript formula in the quote to find the highest value from a list of products

Murilo Silva avatar
Written by Murilo Silva
Updated this week

To set this up, we need to create two fields:

The first one is a quote product field of type plain text.
We need this field to create a list of values for the second field, which will be a block-type field

In this example, I’ll check which of my products has the highest quantity, but you can use any value.

The formula for the first field is:

";[Quotes product.Quantity]"

I named this field "Qtd texto".

Now let’s create the block field. I titled it "Highest Quantity".

const quantity= "[Quotes product.Qtd Texto]"
Math.max.apply(null, quantity.split(';').map(Number))

Did this answer your question?