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

**URL:** https://community.gravityforms.com/t/update-field-value-after-code-in-results-page-is-rendered-resolved/12937
**Category:** Get Help
**Tags:** custom, gfapi
**Created:** [June 29, 2022, 3:57am UTC](https://community.gravityforms.com/t/update-field-value-after-code-in-results-page-is-rendered-resolved/12937 "2022-06-29T03:57:18Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![pringletech](https://avatars.discourse-cdn.com/v4/letter/p/3da27b/32.png) [@pringletech](https://community.gravityforms.com/u/pringletech)
#### Post date: [June 29, 2022, 3:57am UTC](https://community.gravityforms.com/t/update-field-value-after-code-in-results-page-is-rendered-resolved/12937/1 "2022-06-29T03:57:18Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![sacom](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/sacom/32/53_2.png) [@sacom](https://community.gravityforms.com/u/sacom)
#### Post date: [June 29, 2022, 4:34pm UTC](https://community.gravityforms.com/t/update-field-value-after-code-in-results-page-is-rendered-resolved/12937/2 "2022-06-29T16:34:28Z")

</div>

I would recommend you to take a look to the GFAPI class: [GFAPI Class - Gravity Forms Documentation](https://docs.gravityforms.com/api-functions/)

---

<div class="post-metadata">

### Author: ![pringletech](https://avatars.discourse-cdn.com/v4/letter/p/3da27b/32.png) [@pringletech](https://community.gravityforms.com/u/pringletech)
#### Post date: [July 1, 2022, 1:40pm UTC](https://community.gravityforms.com/t/update-field-value-after-code-in-results-page-is-rendered-resolved/12937/3 "2022-07-01T13:40:14Z")

</div>

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

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

> **[Updating Entries with the GFAPI](https://docs.gravityforms.com/updating-entries-with-the-gfapi/)**
>
> The GFAPI::update\_entry(), GFAPI::update\_entries(), GFAPI::update\_entry\_property(), and GFAPI::update\_entry\_field() methods are used to update entries in the database.

Thanks again!

---

<div class="post-metadata">

### Author: ![chrishajer](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/chrishajer/32/88_2.png) [@chrishajer](https://community.gravityforms.com/u/chrishajer)
#### Post date: [July 1, 2022, 3:54pm UTC](https://community.gravityforms.com/t/update-field-value-after-code-in-results-page-is-rendered-resolved/12937/4 "2022-07-01T15:54:34Z")

</div>


