Answers.Body: <p>There was a regression in the action-provider extension that contains the code for the &quot;Get By Email or Create By Email and Names&quot; action.</p>
  <p>This is fixed in the extension's master branch but a new release has not been tagged yet.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-01-25T23:36:50.060Z
Answers.LastActivityDate: 2023-01-25T23:36:50.060Z
Answers.UserDisplayName: Aidan
Body: <p>I am getting an error in a registration form built with <strong>Caldera Forms</strong> and the integration with <strong>CiviCRM's Form Processor</strong></p>
  <p><strong>Error</strong>: <em>Action Create or update phone number failed. Caused by contact_id is not valid: <em><strong>&quot;id&quot;</strong></em></em></p>
  <p>where &quot;<em><strong>id</strong></em>&quot; should be the CiviCRM contact_id, but instead the CiviCRM Form Processor is using <em><strong>civicrm_email.id</strong></em>, and <em><strong>not civicrm_email.contact_id</strong></em>.</p>
  <p>The <em><strong>CiviCRM Form Processor</strong></em> is set up in the following way:</p>
  <p>&quot;actions&quot;: [</p>
  <pre><code>    {
          &quot;name&quot;: &quot;Contact: Get By Email or Create By Email and Names&quot;,
          &quot;configuration&quot;: {
              &quot;contact_type&quot;: &quot;1&quot;
          },
          &quot;mapping&quot;: {
              &quot;email&quot;: &quot;input.email&quot;,
              &quot;first_name&quot;: &quot;input.first_name&quot;,
              &quot;last_name&quot;: &quot;input.last_name&quot;
          }
      },
      {
          &quot;name&quot;: &quot;Contact: Create or update CiviCRM Fields linked to the CiviCRM Contact&quot;,           
          &quot;mapping&quot;: {
            &quot;contact_id&quot;: &quot;action.get_or_create_by_email.contact_id&quot;,
            &lt;more CiviCRM fields to be created/updated based in the input fields of the Caldera 
            Form&gt;
      }
  </code></pre>
  <p>]</p>
  <p>where <em><strong>&quot;contact_id&quot;: &quot;action.get_or_create_by_email.contact_id&quot;</strong></em> is retrieving the <em><strong>civicrm_email.id</strong></em>, <em><strong>not civicrm_email.contact_id</strong></em> and consequently I am getting the following <em><strong>DB Error</strong></em>:</p>
  <p><em>constraint violation: a foreign key constraint fails</em></p>
  <p>as the Form Processor is trying to create/update fields of the CiviCRM Contact, but there is not contact_id with id = <em><strong>civicrm_email.id</strong></em>.</p>
  <p>When I disable the &quot;<em><strong>User Registration</strong></em>&quot; Form Processor in the Caldera Form , which creates the <strong>WordPress User</strong>, the process works perfectly. But if this Form Processor is enabled to create the WordPress user, the process fails.</p>
  <p>Any clue will be very much appreciated.</p>
  
Tags: <wordpress><caldera-forms><form-processor>
Title: CiviCRM's Form Processor failing when "User Registration" Form Processor in Caldera Forms is enabled to create the WordPress User
ThreadText: # CiviCRM's Form Processor failing when "User Registration" Form Processor in Caldera Forms is enabled to create the WordPress User
  
  (Asked by: username_0 on 2023-01-05)
  
  I am getting an error in a registration form built with **Caldera Forms** and the integration with **CiviCRM's Form Processor**
  
  **Error**: *Action Create or update phone number failed. Caused by contact\_id is not valid: ***"id"****
  
  where "***id***" should be the CiviCRM contact\_id, but instead the CiviCRM Form Processor is using ***civicrm\_email.id***, and ***not civicrm\_email.contact\_id***.
  
  The ***CiviCRM Form Processor*** is set up in the following way:
  
  "actions": [
  
  ```
      {
          "name": "Contact: Get By Email or Create By Email and Names",
          "configuration": {
              "contact_type": "1"
          },
          "mapping": {
              "email": "input.email",
              "first_name": "input.first_name",
              "last_name": "input.last_name"
          }
      },
      {
          "name": "Contact: Create or update CiviCRM Fields linked to the CiviCRM Contact",           
          "mapping": {
            "contact_id": "action.get_or_create_by_email.contact_id",
            <more CiviCRM fields to be created/updated based in the input fields of the Caldera 
            Form>
      }
  
  ```
  
  ]
  
  where ***"contact\_id": "action.get\_or\_create\_by\_email.contact\_id"*** is retrieving the ***civicrm\_email.id***, ***not civicrm\_email.contact\_id*** and consequently I am getting the following ***DB Error***:
  
  *constraint violation: a foreign key constraint fails*
  
  as the Form Processor is trying to create/update fields of the CiviCRM Contact, but there is not contact\_id with id = ***civicrm\_email.id***.
  
  When I disable the "***User Registration***" Form Processor in the Caldera Form , which creates the **WordPress User**, the process works perfectly. But if this Form Processor is enabled to create the WordPress user, the process fails.
  
  Any clue will be very much appreciated.
  
  **Tags:** wordpress, caldera-forms, form-processor
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2023-01-25. Score: 1
  
  There was a regression in the action-provider extension that contains the code for the "Get By Email or Create By Email and Names" action.
  
  This is fixed in the extension's master branch but a new release has not been tagged yet.
  
  
  ---
  
  