Answers.Body: <p>Try using the machine name instead of Label or Value. I believe for some cases it uses machine names rather value or label. You can find the machine name either using sql stmt or through api explorer.</p>
  
  <p><a href="https://civicrm.stackexchange.com/questions/26064/i-keep-getting-payment-instrument-not-valid-when-trying-to-import-contributions">Here</a> is an example of some cases where value or label didn't work during import.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-29T14:30:22.787Z
Answers.Text: I'm assuming the machine name is the 'name' in the civicrm_option_values table? This didn't work either, I'm afraid. (I'd thought 'Value' was the machine name, so thanks for the clarifcation!)
Answers.UserDisplayName: liblogger
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-28T15:57:42.653Z
Answers.LastActivityDate: 2018-08-28T15:57:42.653Z
Answers.UserDisplayName: Pradeep Nayak
Body: <p>I'm having problems importing memberships with a custom field. I'm able to import a alphanumeric text field without an error, but a second custom field, set up as a checkbox, keeps being rejected. </p>
  
  <p>The import CSV file originally had the option label in that field, but after changing this to the option value, the import is still rejected as invalid. What might I be missing here?</p>
  
  <p>The original import error reads 'Invalid value for field(s) : Income; Income' </p>
  
  <p>When I change the relevant fields to the correct value 'LowIncome' (having double checked that it's the value stored in the database), the import error reads:</p>
  
  <p>'1' is not a valid option for field custom_33 </p>
  
  <p>Which is technically correct, but none of the fields in the imported file contain '1', so I don't know where it's getting this from!</p>
  
  <p>Because there's only the one option, I'm pretty sure I can swap this out for a Yes/No field and try it again, but I'd rather pin down why this is happening - I also have some activities to import with multi-option checkboxes, and I'd rather know they'll work...</p>
  
  <p>ETA: I've tried adding in another field, where the option label, value and name are all the same ('Test'), and importing it - It gets flagged in the same way - '1' is not a valid option for field custom_34</p>
  
  <p>I also tried adding a yes/no field, and that imports okay, so I'm probably going to switch this particular field to a yes/no, but as I say, I'm concerned that it's going to reject other multichoice fields, and I'd still like to pin down the problem. I will try importing some of the activities, and update this when I know how it's behaving. </p>
  
  <p>ETA2: This seems to be happening for any checkbox field, regardless of what the custom data set is used for, and isn't limited to fields with single checkboxes. I'm able to reproduce the problem in the master demo site, and importing from my new installation to the older version of CiviCRM also comes up with this error. </p>
  
  <p>I've found a issue on the old bug tracker site that seems very similar in 4.7/4.7 - <a href="https://issues.civicrm.org/jira/browse/CRM-17493" rel="nofollow noreferrer">https://issues.civicrm.org/jira/browse/CRM-17493</a> - and although it's marked as fixed, it looks a little as though the fix was never implemented in 4.7 - the last git pull request is marked as closed with the note 'Unclear if a fix is required or not': <a href="https://issues.civicrm.org/jira/browse/CRM-17493" rel="nofollow noreferrer">https://issues.civicrm.org/jira/browse/CRM-17493</a> (but it's also not entirely equivalent to the problem I've been having)</p>
  
  <p>Failing any further ideas as to what I might be doing wrong, I'll raise it as a bug.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-08-28T15:46:57.937Z
Comments.Text: can you run an sql statement to update a checkbox to 'LowIncome'?  if yes it's probably a formatting problem with your csv file?  If no then you need to figure out what value you are able to set the field to.
Comments.UserDisplayName: dgk112
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-08-29T14:31:41.637Z
Comments.Text: I'm honestly not sure how to update a field via sql - I'm happy to try it but literally don't know how :(
Comments.UserDisplayName: liblogger
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-08-29T14:33:13.960Z
Comments.Text: The csv file has been exported from another (older) installation of CiviCRM, and I've been editing it both as a text file and in Excel - they all fail, but I wouldn't have thought it's a formatting issue when the other fields are okay. What might I be missing?
Comments.UserDisplayName: liblogger
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-08-29T20:26:23.873Z
Comments.Text: https://www.tutorialspoint.com/sql/sql-update-query.htm syntax for SQL update statement here so (assuming you have phpmyadmin access to your database)  update [Table] set field = 'Lowincome' where [id] =
Comments.UserDisplayName: dgk112
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-09-07T18:41:29.190Z
Comments.Text: does that help at all?  have you managed to get the data imported now?
Comments.UserDisplayName: dgk112
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-09-10T12:39:08.153Z
Comments.Text: A different problem took priority last week, so I haven't had a chance to try this further - will be looking at it again this week.
Comments.UserDisplayName: liblogger
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-09-12T15:29:27.967Z
Comments.Text: I'm able to update the field to the expected 'LowIncome' value via sql, but can't get the UI to import the field; I've tried reproducing this on the demo site, and got the same error; Also tried importing a field with more than one possible value - same error; Similar check on a checkbox field for an activity - same error. And I get the same error when trying to import from the new installation to the original one.
Comments.UserDisplayName: liblogger
Tags: <civimember><custom-fields><import>
Title: Importing membership custom field keeps failing
ThreadText: # Importing membership custom field keeps failing
  
  (Asked by: username_0 on 2018-08-28)
  
  I'm having problems importing memberships with a custom field. I'm able to import a alphanumeric text field without an error, but a second custom field, set up as a checkbox, keeps being rejected.
  
  The import CSV file originally had the option label in that field, but after changing this to the option value, the import is still rejected as invalid. What might I be missing here?
  
  The original import error reads 'Invalid value for field(s) : Income; Income'
  
  When I change the relevant fields to the correct value 'LowIncome' (having double checked that it's the value stored in the database), the import error reads:
  
  '1' is not a valid option for field custom\_33
  
  Which is technically correct, but none of the fields in the imported file contain '1', so I don't know where it's getting this from!
  
  Because there's only the one option, I'm pretty sure I can swap this out for a Yes/No field and try it again, but I'd rather pin down why this is happening - I also have some activities to import with multi-option checkboxes, and I'd rather know they'll work...
  
  ETA: I've tried adding in another field, where the option label, value and name are all the same ('Test'), and importing it - It gets flagged in the same way - '1' is not a valid option for field custom\_34
  
  I also tried adding a yes/no field, and that imports okay, so I'm probably going to switch this particular field to a yes/no, but as I say, I'm concerned that it's going to reject other multichoice fields, and I'd still like to pin down the problem. I will try importing some of the activities, and update this when I know how it's behaving.
  
  ETA2: This seems to be happening for any checkbox field, regardless of what the custom data set is used for, and isn't limited to fields with single checkboxes. I'm able to reproduce the problem in the master demo site, and importing from my new installation to the older version of CiviCRM also comes up with this error.
  
  I've found a issue on the old bug tracker site that seems very similar in 4.7/4.7 - <https://issues.civicrm.org/jira/browse/CRM-17493> - and although it's marked as fixed, it looks a little as though the fix was never implemented in 4.7 - the last git pull request is marked as closed with the note 'Unclear if a fix is required or not': <https://issues.civicrm.org/jira/browse/CRM-17493> (but it's also not entirely equivalent to the problem I've been having)
  
  Failing any further ideas as to what I might be doing wrong, I'll raise it as a bug.
  
  **Tags:** civimember, custom-fields, import
  
  > **Comments:**
  > **username_1**: can you run an sql statement to update a checkbox to 'LowIncome'?  if yes it's probably a formatting problem with your csv file?  If no then you need to figure out what value you are able to set the field to.  
  > **username_0**: I'm honestly not sure how to update a field via sql - I'm happy to try it but literally don't know how :(  
  > **username_0**: The csv file has been exported from another (older) installation of CiviCRM, and I've been editing it both as a text file and in Excel - they all fail, but I wouldn't have thought it's a formatting issue when the other fields are okay. What might I be missing?  
  > **username_1**: https://www.tutorialspoint.com/sql/sql-update-query.htm syntax for SQL update statement here so (assuming you have phpmyadmin access to your database)  update [Table] set field = 'Lowincome' where [id] =  
  > **username_1**: does that help at all?  have you managed to get the data imported now?  
  > **username_0**: A different problem took priority last week, so I haven't had a chance to try this further - will be looking at it again this week.  
  > **username_0**: I'm able to update the field to the expected 'LowIncome' value via sql, but can't get the UI to import the field; I've tried reproducing this on the demo site, and got the same error; Also tried importing a field with more than one possible value - same error; Similar check on a checkbox field for an activity - same error. And I get the same error when trying to import from the new installation to the original one.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2018-08-28. Score: 1
  
  Try using the machine name instead of Label or Value. I believe for some cases it uses machine names rather value or label. You can find the machine name either using sql stmt or through api explorer.
  
  [Here](https://civicrm.stackexchange.com/questions/26064/i-keep-getting-payment-instrument-not-valid-when-trying-to-import-contributions) is an example of some cases where value or label didn't work during import.
  
  > **Comments:**
  > **username_0**: I'm assuming the machine name is the 'name' in the civicrm_option_values table? This didn't work either, I'm afraid. (I'd thought 'Value' was the machine name, so thanks for the clarifcation!)  
  
  ---
  
  