Support

Account

Home Forums General Issues Populate ACF File field from Gravity Forms Reply To: Populate ACF File field from Gravity Forms

  • The issue with the code that you posted is that is says

    
    update_field( 'YOUR_FIELD_NAME', $attachment_id, $post_id );
    

    If you use the field name as this code suggests, and the field does not already have a value (exists in the database) then the ACF field will not be updated properly. When updating fields that do not already have values you must use the field key instead of the field name.

    This is covered in the update_field() documentation https://www.advancedcustomfields.com/resources/acf-update_field/