1

I've just created a new field with a 'yes/no' answer. Can I auto-fill all records with a specific answer?

1

Once you set the default value, you have to somehow trigger an update for your contact records so the default value gets populated. One way to do this might be to export a minimum of contact fields and re-import them (careful with this technique, unless you do it properly you'll create a lot of duplicate contacts in your db!).

  • Generally yes, but you may not need to. Setting a default value (for some types of custom field) when the custom field is created causes contacts that already have values for other fields in the same custom group to be updated automatically. In other words, existing records in the relevant civicrm_value_* table are updated with the default value for the new field. This does not happen if the custom field is reconfigured to have a default value after its initial creation. The behaviour depends on the type of field - so eg a yes/no behaves this way, but a select does not. – Aidan Mar 30 '17 at 11:03
  • This only works if a given contact already has some data in that custom set. – Coleman Mar 31 '17 at 14:40
0

You can set a default value in the custom field definition.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.