Title: Gravity Forms Mapping Form Fields
Last modified: April 1, 2023

---

# Gravity Forms Mapping Form Fields

 *  Resolved [LvPnk](https://wordpress.org/support/users/lvpnk/)
 * (@lvpnk)
 * [3 years ago](https://wordpress.org/support/topic/gravity-forms-mapping-form-fields/)
 * Hello,
 * I’m trying to map all my form fields to Mailchimp. Currently only the e-mail 
   field is showing up in the submission in Mailchimp. I did some searching in the
   forums and was able to find some code to start with:
 *     ```wp-block-code
       add_filter( 'mc4wp_integration_gravity-forms_subscriber_data', function( MC4WP_MailChimp_Subscriber $subscriber ) {
       $subscriber->merge_fields[ "FNAME" ] = sanitize_text_field( $_POST['input_1.3'] );
       $subscriber->merge_fields[ "LNAME" ] = sanitize_text_field( $_POST['input_1.6'] );
       $subscriber->merge_fields[ "ADDRESS" ] = sanitize_text_field( $_POST['input_8'] );
       $subscriber->merge_fields[ "PHONE" ] = sanitize_text_field( $_POST['input_4'] );
       return $subscriber;
       });
       ```
   
 * Originally I was using the gravity forms address field but read that it could
   cause issues and to switch to a regular text field. It looks like now only the
   phone number is coming through in Mailchimp. Could someone help me with what 
   I could be doing wrong? Thank you.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fgravity-forms-mapping-form-fields%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Contributor [Harish Chouhan](https://wordpress.org/support/users/hchouhan/)
 * (@hchouhan)
 * [3 years ago](https://wordpress.org/support/topic/gravity-forms-mapping-form-fields/#post-16619931)
 * Hey [@lvpnk](https://wordpress.org/support/users/lvpnk/),
 * Can you please go to the “MC4WP > Others” menu, and share with us if there are
   any errors listed there?
   Also, can you please double check if the “FNAME”, “LNAME”&“
   ADDRESS” field names in Gravity forms are same as you have included in the code?
 *  Thread Starter [LvPnk](https://wordpress.org/support/users/lvpnk/)
 * (@lvpnk)
 * [3 years ago](https://wordpress.org/support/topic/gravity-forms-mapping-form-fields/#post-16623401)
 * Hello, thank you for your reply. I did some more research after seeing the error
   listed there, “Gravity Forms > Mailchimp API Error: Bad Request. Invalid Resource.
   Your merge fields were invalid.
   – FNAME : Please enter a value– LNAME : Please
   enter a value– ADDRESS : Please enter a value”
 * Out of the box gravity forms doesn’t seem to allow the field names to be changed.
   Is there a way to do this with code?
 *  Plugin Contributor [Harish Chouhan](https://wordpress.org/support/users/hchouhan/)
 * (@hchouhan)
 * [3 years ago](https://wordpress.org/support/topic/gravity-forms-mapping-form-fields/#post-16624799)
 * Hey [@lvpnk](https://wordpress.org/support/users/lvpnk/),
 * That error is because as you are aware, the fields are not sent to MailChimp 
   and you must have set them as “required” fields. You can set them as not required
   for the time being.
 * Regarding the original issue, can you try setting up 2 different text fields 
   for “FNAME” & “LNAME” and then update the custom code to match these field names?

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

The topic ‘Gravity Forms Mapping Form 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: [Harish Chouhan](https://wordpress.org/support/users/hchouhan/)
 * Last activity: [3 years ago](https://wordpress.org/support/topic/gravity-forms-mapping-form-fields/#post-16624799)
 * Status: resolved