I have used the following code and inserted it into code snippets - does it need something else to work?
When I make or edit an entry the Field 4 is not being updated.
Make sure to replace the 85 in the gform_pre_submission_85 hook with the actual ID of your Gravity Form.
If the code still doesn’t work, you may want to check for any error messages or if the hook is being triggered by adding a debugging statement to the function.