Real-time Update of Equation Field based on Number Field

Hi! I have a number field (number of program hours) that informs an equation field (75% of program hours). i have both fields in a modal pop-up form page, and i want the equation field to update live in real-time when the values are entered or changed in the number field. is there a way to do this in knack?

Thanks in advance!

Hello Quynh,

It’s worked previously in knack but not now. Now to achieve this we use JavaScript. On change event we calculate value and fill into that field

Regards,
Sunny Singla

Oh bummer! I wonder why they removed this feature. It was such a great one.

Yes, But I have no Idea.

I’m not 100% sure… But now I use Javascript to achieve this feature.

Thanks

Hi @Quynh-Tram,

That’s a good question! As long as the number field and any other fields used in the equation field are fields included in the form view, the equation field will update in real time when the end users of your live app enter data into the number fields and any other fields you may be using for the calculation. However, some limitations may prevent your equation field from updating.

See this article here for an example and current limitations: Real-Time Equation Calculations in Forms

Hi

Based on what Les is saying could you not include the equation field in the form but then hide it using the KTL keyword _hf?

Dean

1 Like

I was able to figure it out. Do not do “read-only” or “display value only” for the equation field. Much thanks.

1 Like

@Quynh-Tram Awesome, I’m glad you were able to get it figured out! :tada:

I was curious, so I went to test an edit form view where the equation field in the view had “Display the field value without a form input” checked. When I tested the edit form in the Live App, the equation field value was still updated in real-time.

2024-08-20_12-12-36 (1)

I’m now wondering if I’m misunderstanding your setup. :thinking: