Body: <p>We are using CiviCRM (4.7.9) with WordPress (4.5.3). We are pulling the data from the CiviCRM state and country tables into Gravity Forms using code in our function.php. But we are running into problems when a Country does not have a State.  The WP Gravity form will save all the data, no problem.  And the web hooks that we are using between WP and CiviCRM will send the info into Civicrm, but it will not send the Country information when there is no State, even though there is no corresponding State for these Countries in the CiviCRM tables. Is there another value we are suppose to send? A Null value? </p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-07-28T08:42:20.747Z
Comments.Text: I think a code sample would be useful to understand what is going on, ie are you using Civi's API, SQL?
Comments.UserDisplayName: Andrei
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-07-28T18:27:10.997Z
Comments.Text: we added code to wp function.php
Comments.UserDisplayName: Nina Gonzalez
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-07-29T08:15:25.120Z
Comments.Text: I don't see how you save the data to Civi, there should be a `gform_after_submission` action hook
Comments.UserDisplayName: Andrei
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-07-30T16:55:21.373Z
Comments.Text: we are using a civicrm extension from civivip that works with gravity forms and civicrm.
Comments.UserDisplayName: Nina Gonzalez
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-08-02T08:53:34.333Z
Comments.Text: Nina I'm afraid I cannot point you in any direction without knowing how the data is sent/saved from GForms to CiviCRM, I suggest you get in touch CiviVIP and explain them the issue.
  I also suggest you use Civi's API to retrieve data from Civi, I added a gist following GForm's guide here  https://gist.github.com/mecachisenros/d0eec1f657ae0ee39f383a13a32e5ccd that instead of targeting the fields on a form_id/field_id basis you would just add a class like `civicrm-country` or `civicrm-state-province` to the dropdown that you want to be populated with Civi data
Comments.UserDisplayName: Andrei
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-08-03T14:54:45.303Z
Comments.Text: This is very helpful. Thank you. Yes, will contact CiviVIP for help. Seems this is a bug in their plugin.
Comments.UserDisplayName: Nina Gonzalez
Tags: <wordpress><database><hooks>
Title: How to connect with state and country table
ThreadText: # How to connect with state and country table
  
  (Asked by: username_0 on 2016-07-27)
  
  We are using CiviCRM (4.7.9) with WordPress (4.5.3). We are pulling the data from the CiviCRM state and country tables into Gravity Forms using code in our function.php. But we are running into problems when a Country does not have a State. The WP Gravity form will save all the data, no problem. And the web hooks that we are using between WP and CiviCRM will send the info into Civicrm, but it will not send the Country information when there is no State, even though there is no corresponding State for these Countries in the CiviCRM tables. Is there another value we are suppose to send? A Null value?
  
  **Tags:** wordpress, database, hooks
  
  > **Comments:**
  > **username_1**: I think a code sample would be useful to understand what is going on, ie are you using Civi's API, SQL?  
  > **username_0**: we added code to wp function.php  
  > **username_1**: I don't see how you save the data to Civi, there should be a `gform_after_submission` action hook  
  > **username_0**: we are using a civicrm extension from civivip that works with gravity forms and civicrm.  
  > **username_1**: Nina I'm afraid I cannot point you in any direction without knowing how the data is sent/saved from GForms to CiviCRM, I suggest you get in touch CiviVIP and explain them the issue. I also suggest you use Civi's API to retrieve data from Civi, I added a gist following GForm's guide here  https://gist.github.com/mecachisenros/d0eec1f657ae0ee39f383a13a32e5ccd that instead of targeting the fields on a form_id/field_id basis you would just add a class like `civicrm-country` or `civicrm-state-province` to the dropdown that you want to be populated with Civi data  
  > **username_0**: This is very helpful. Thank you. Yes, will contact CiviVIP for help. Seems this is a bug in their plugin.  
  
  ---
  
  ## 0 answers
  
  