There isn't a single document or tutorial that currently covers this entire process. It's made up of a bunch of different moving pieces.
If you are populating a form with existing user data you would have to dynamically populate the necessary form fields with the values you want to populate them with. You do this just like you would anytime you are dynamically populating form fields. There are several tutorials on how to dynamically populate fields here:
http://www.gravityhelp.com/documentation/page/How_To
The main piece of this is when the form is submitted. You then have to use hooks to take the data that is submitted and update whatever data you are updating. If this is a profile and you are updating user data, then you have to use hooks to get the field values and then update the user meta data for that user.
If you are using Gravity Forms v1.6 beta you would use the gform_after_submission hook which is documented here:
http://www.gravityhelp.com/documentation/page/Gform_after_submission
If you are using an older version of Gravity Forms you would use the gform_post_submission hook which is documented here:
http://www.gravityhelp.com/documentation/page/Gform_post_submission
After you use these hooks to read the values and update the existing data you would then have to decide if you want to keep the entry that was created automatically by them submitting the form. If you are just updating user meta profile data, chances are you don't want to keep the entry.
If you want to delete the entry then you have to do this using hooks. There is a forum post that discusses this here:
http://www.gravityhelp.com/forums/topic/purposefully-not-save-form-in-entries-database#post-15601
Note in that forum post it uses the gform_post_submission hook but if you are using Gravity Forms v1.6 you would want to use the gform_after_submission hook to do the same thing.
So what you want to do is actually 3 separate pieces that you have to put together to accomplish having a form that is dynamically populated with user profile data and then when submitted it updates that data.
Posted 13 years ago on Wednesday September 21, 2011 |
Permalink