Hello @pvtsolver
You can create a server-side equation to increase a number in the database and call this equation from a calculated field in the form. The code of the server-side equation can be as simple as:
$GLOBALS['SERVER_SIDE_EQUATIONS']['increase_counter'] = function(){
$counter = get_option('calculate_button_clicked', 0)+1;
update_option('calculate_button_clicked', $counter);
return $counter;
};
More information about the server-side equations by reading the following posts in the plugin’s blog:
https://cff.dwbooster.com/blog/2018/10/01/server-side-equations
https://cff.dwbooster.com/blog/2019/08/04/partial
For reading the counter in the form, you can use a DS field with a query similar to:
SELECT option_value as value FROM {wpdb.options} WHERE option_name="calculate_button_clicked"
More information about the use of data source fields by reading the following post in the plugin’s blog:
https://cff.dwbooster.com/blog/2019/02/14/ds/
Best regards.