Answers.Body: <p>On 5.63 and 5.67 (dmaster) this works with the API CSV extension 1.12. May have been an issue on 1.1.</p>
  <p><a href="https://i.sstatic.net/5Ib98.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/5Ib98.png" alt="enter image description here" /></a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-09-13T21:02:22.960Z
Answers.LastActivityDate: 2023-09-13T21:02:22.960Z
Answers.UserDisplayName: Andy Burns
Body: <p>WP 6.03, CiviCRM 5.51.3, API CSV importer 1.1.  I'm attempting to import an activity via this extension since I need to include the assignee (which isn't included in the standard activity import).  The queue runner hangs each time without completing.</p>
  <p>These are the fields I'm including: activity type (I've tried both the ID and the label), activity date, source contact (using contact ID), target contact (using contact ID), assignee contact (using contact ID), status, subject, priority.</p>
  <p>Inspecting the log shows me this error:</p>
  <p>$CRM_Queue_ErrorPolicy_reportError = Array
  (
  [is_error] =&gt; 1
  [is_continue] =&gt; 0
  [exception] =&gt; Error 1: Uncaught TypeError: Argument 1 passed to civicrm_api4() must be of the type string, null given, called in /home/XXXX/www/www/wp-content/plugins/civicrm/civicrm/CRM/Import/Parser.php on line 1470 and defined in /home/XXXX/www/www/wp-content/plugins/civicrm/civicrm/api/api.php:62</p>
  <p>Stack trace:</p>
  <p>#0 /home/XXXX/www/www/wp-content/plugins/civicrm/civicrm/CRM/Import/Parser.php(1470): civicrm_api4(NULL, 'getFields', Array)</p>
  <p>#1 /home/XXXX/www/www/wp-content/plugins/civicrm/civicrm/CRM/Import/Parser.php(1408): CRM_Import_Parser-&gt;getFieldMetadata('source_contact_...', true)</p>
  <p>#2 /home/XXXX/www/www/wp-content/plugins/civicrm/civicrm/CRM/Import/Parser.php(1364): CRM_Import_Parser-&gt;getFieldOptions('source_contact_...')</p>
  <p>#3 /home/XXXX/www/www/wp-content/plugins/civicrm/civicrm/CRM/Import/Parser.php(1857): CRM_Import_Parser-&gt;getTransformedFieldValue('source_contact_...', '56186')</p>
  <p>#4 /home/XXXX/www/www/wp-content/uploads/civicrm/extensions/nz.co.fuzion.csvimport/CRM/Csvimport/Import/ in /home/XXXX/www/www/wp-content/plugins/civicrm/civicrm/api/api.php, line 62
  [last_task_title] =&gt; Processed 1 rows out of 1
  )</p>
  <p>This would seem to suggest that I'm missing a required field but it's really difficult to tell, and of course there's no error guidance generated.  Any ideas where my problem lies?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-10-20T02:07:05.243Z
Comments.Text: and you definitely had your date format right? have you tested your csv (anonymised) on eg dmaster.demo.civicrm.org just to compare. you can add the ext' n via https://dmaster.demo.civicrm.org/civicrm/admin/extensions?reset=1&selectedChild=addnew
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-10-24T12:16:45.403Z
Comments.Text: I tested multiple date formats, confirming each time that they matched - no luck.  However, I did _not_ test on the demo site; I'll do that next.  Thanks for the suggestion.
Comments.UserDisplayName: Lesley Carter - BackOffice
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-10-28T17:49:40.713Z
Comments.Text: Testing on the demo site resulted in the same thing - no activity added, and no discernible error.  I also added the Log Viewer module and the log entries are as follows: [info] Running task: Processed 1 rows out of 1
Comments.UserDisplayName: Lesley Carter - BackOffice
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-10-29T21:16:07.513Z
Comments.Text: may be time to open an Issue on the extension repo with steps how to replicate
Comments.UserDisplayName: petednz - fuzion
Tags: <import><activity><csv>
Title: Issue with API CSV importer and activity imports
ThreadText: # Issue with API CSV importer and activity imports
  
  (Asked by: username_0 on 2022-10-19)
  
  WP 6.03, CiviCRM 5.51.3, API CSV importer 1.1. I'm attempting to import an activity via this extension since I need to include the assignee (which isn't included in the standard activity import). The queue runner hangs each time without completing.
  
  These are the fields I'm including: activity type (I've tried both the ID and the label), activity date, source contact (using contact ID), target contact (using contact ID), assignee contact (using contact ID), status, subject, priority.
  
  Inspecting the log shows me this error:
  
  $CRM\_Queue\_ErrorPolicy\_reportError = Array
  (
  [is\_error] => 1
  [is\_continue] => 0
  [exception] => Error 1: Uncaught TypeError: Argument 1 passed to civicrm\_api4() must be of the type string, null given, called in /home/XXXX/www/www/wp-content/plugins/civicrm/civicrm/CRM/Import/Parser.php on line 1470 and defined in /home/XXXX/www/www/wp-content/plugins/civicrm/civicrm/api/api.php:62
  
  Stack trace:
  
  #0 /home/XXXX/www/www/wp-content/plugins/civicrm/civicrm/CRM/Import/Parser.php(1470): civicrm\_api4(NULL, 'getFields', Array)
  
  #1 /home/XXXX/www/www/wp-content/plugins/civicrm/civicrm/CRM/Import/Parser.php(1408): CRM\_Import\_Parser->getFieldMetadata('source\_contact\_...', true)
  
  #2 /home/XXXX/www/www/wp-content/plugins/civicrm/civicrm/CRM/Import/Parser.php(1364): CRM\_Import\_Parser->getFieldOptions('source\_contact\_...')
  
  #3 /home/XXXX/www/www/wp-content/plugins/civicrm/civicrm/CRM/Import/Parser.php(1857): CRM\_Import\_Parser->getTransformedFieldValue('source\_contact\_...', '56186')
  
  #4 /home/XXXX/www/www/wp-content/uploads/civicrm/extensions/nz.co.username_1.csvimport/CRM/Csvimport/Import/ in /home/XXXX/www/www/wp-content/plugins/civicrm/civicrm/api/api.php, line 62
  [last\_task\_title] => Processed 1 rows out of 1
  )
  
  This would seem to suggest that I'm missing a required field but it's really difficult to tell, and of course there's no error guidance generated. Any ideas where my problem lies?
  
  **Tags:** import, activity, csv
  
  > **Comments:**
  > **username_1**: and you definitely had your date format right? have you tested your csv (anonymised) on eg dmaster.demo.civicrm.org just to compare. you can add the ext' n via https://dmaster.demo.civicrm.org/civicrm/admin/extensions?reset=1&selectedChild=addnew  
  > **username_0**: I tested multiple date formats, confirming each time that they matched - no luck.  However, I did _not_ test on the demo site; I'll do that next.  Thanks for the suggestion.  
  > **username_0**: Testing on the demo site resulted in the same thing - no activity added, and no discernible error.  I also added the Log Viewer module and the log entries are as follows: [info] Running task: Processed 1 rows out of 1  
  > **username_1**: may be time to open an Issue on the extension repo with steps how to replicate  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2023-09-13. Score: 0
  
  On 5.63 and 5.67 (dmaster) this works with the API CSV extension 1.12. May have been an issue on 1.1.
  
  [![enter image description here](https://i.sstatic.net/5Ib98.png)](https://i.sstatic.net/5Ib98.png)
  
  
  ---
  
  