Update field value after code in results page is rendered [RESOLVED]

I have a results page that has the entryID and processes the uses all the submitted data to build a project estimate table. At the end of the table I display the total cost and cost per sqr. ft. that has been calculated by the PHP of the results page.

I would like to write those values into hidden fields after I have produced the table. Because now I want to build a list of estimates produced by that user and have the cost as a column. I was planning on using gravity kit to build that on a different page.

What is an easy way to update a hidden field when I know the entryID, fieldID, and field value. I do not think I need an action/hook because I need to run that at the end of my PHP where I get the final cost that I have calculated.

Hope this makes a little sense.

Thank you in advance for your help.

I would recommend you to take a look to the GFAPI class: GFAPI Class - Gravity Forms Documentation

Thank you for the direction. This is ultimately what worked for me.

$result = GFAPI::update_entry_field( $entry_id , $input_id , $value );

Thanks again!