Title: Gravity forms fields
Last modified: August 18, 2020

---

# Gravity forms fields

 *  Resolved [rparenter](https://wordpress.org/support/users/rparenter/)
 * (@rparenter)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/gravity-forms-fields/)
 * Hi,
 * How can sync other fields of gravity forms, like first name and phone? I tried
   to find out but I didn’t find it.
 * Thanks,
    Rui Parente

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Contributor [Lap](https://wordpress.org/support/users/lapzor/)
 * (@lapzor)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/gravity-forms-fields/#post-13276392)
 * Hi Tui,
 * The problem with Grafity forms in this regards is that it generates field names
   sort of randomly, such as name=”input_4″ so it’s hard for MC4WP to know what 
   field is what.
 * The only way to do it is if you manually map those field names (you can get them
   via “right click > inspect” when you view the form) to the correct MailChimp 
   fields with some custom code.
 *     ```
       add_filter( 'mc4wp_integration_gravity-forms_subscriber_data', function( MC4WP_MailChimp_Subscriber $subscriber ) {
       $subscriber->merge_fields[ "FNAME" ] = sanitize_text_field( $_POST['input_2'] );
       $subscriber->merge_fields[ "COUNTRY" ] = sanitize_text_field( $_POST['input_4'] );
       return $subscriber;
       });
       ```
   
 * This example would map input_2 to FNAME and input_4 to the MailChimp field COUNTRY.
 * Hope that helps. If you have any questions, please let me know!
 *  Thread Starter [rparenter](https://wordpress.org/support/users/rparenter/)
 * (@rparenter)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/gravity-forms-fields/#post-13279745)
 * Hi!
 * Perfect, it works.
 * One last question, how about the city field?
    I have tried:
 * $subscriber->merge_fields[ “ADDRESS” ][“city”] = sanitize_text_field( $_POST[‘
   input_17’] );
 * and
 * $subscriber->merge_fields[“CITY”] = sanitize_text_field( $_POST[‘input_17’] );
 * And didn’t work.
 * Best regards,
    Rui Parente
 *  Plugin Contributor [Lap](https://wordpress.org/support/users/lapzor/)
 * (@lapzor)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/gravity-forms-fields/#post-13280968)
 * I recommend not using fields of the type “address” in MailChimp as they have 
   a pretty strict validation on that field. If you want that to work you need to
   send in a whole complete address, not just the city, and it all needs to be valid.
 * I recommend using a normal text field instead.
 * Hope that helps. If you have any questions, please let me know!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Gravity forms fields’ is closed to new replies.

 * ![](https://ps.w.org/mailchimp-for-wp/assets/icon-256x256.png?rev=1224577)
 * [MC4WP: Mailchimp for WordPress](https://wordpress.org/plugins/mailchimp-for-wp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/mailchimp-for-wp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/mailchimp-for-wp/)
 * [Active Topics](https://wordpress.org/support/plugin/mailchimp-for-wp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/mailchimp-for-wp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/mailchimp-for-wp/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Lap](https://wordpress.org/support/users/lapzor/)
 * Last activity: [5 years, 9 months ago](https://wordpress.org/support/topic/gravity-forms-fields/#post-13280968)
 * Status: resolved