Perform calculation inside a CMS item

I have a Webflow CMS page where there are 6 items within which I want to do a calculation and reflect the value it in the 6th item:

Calculation that I want to achieve:

Rental Yield: Rental Per Week * 52 / Purchased Price * 100

  • Rental Yield is the 6th field.

Field that is required for the calculation:

Field 1: Purchase Price [ It has a $ sign before the number ]
Field 2: Current Value [ It has a $ sign before the number ]

How do I achieve this?

Thank You

It’s not complex JS, but how you write it will depend on your HTML structure.
Since you’re asking, I’m assuming you’re not a developer.

You can hire one, or you can learn with the assistance of a tool like chatGPT.

1 Like

Hello Varun,

You can give the fields elements unique IDs on your Webfow CMS page

Then use JS to get the value for each fields data

…then execute the formula you’ve shared.

You’ll just need to work with the DOM and JS functions here.

Hope this helps

1 Like