Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

I do a LOT of work with percentage fields… calculating margins, markups, markdowns, fees, discounts etc.

Most of the time, due to the size of the end result formula fields I can not do these percentage calculations as formulas.

Eg

  • Base Amount

  • Add Fee A @ 2.75% of Base Prices

  • Add Fee B @ 1.258% of Base Price

  • Subtotal

  • Add Fee C @ 4.85% of Subtotal Price

  • Total

  • Discount Total by 1.035%

  • Gross Amount

  • Then multiply the Sale Price by 1/1.095 to get the Net Amount

If you’ve ever been to Dreamforce, remember the shock of getting your hotel bill and seeing all the various taxes detailed out… something like that.

I’ve been using Flows to clone records…

But I have to do something like

If Party X is paying the fee then put the percentage into Fee A% field, otherwise put the fee into Fee B% field

If Party Y is paying the fee then do the opposite.

I could NOT work out why my percentages were always incorrect in Flows

So I’ve done some testing.

I have 4 percentage fields - each of them are 3 decimal places:

  • Set a number variable as a passed in percentage field

  • Input a percentage field

  • Update percentage field from the previously saved value

  • Update a percentage field from a formula

Update the Record

No.

Field Type

Start Value

End Value

1

Update the record with the exact value from the same field on the Get Record

2.55

2.55

2

Update the field with the passed in variable percent

2.789

2.789

3

Update the field with the input percent

10.543

10.543

4

Update the field with the formula percent. The formula is just the value of the exact field that is being updated, from the Get Record.

8.253

0.083

End Value

If you need to deal with percentage fields in a formula, ensure you multiply them by 100 before using them in an Update in Flow.

This may have seemed obvious, but it wasn’t until I went through it step by step.

  • No labels