if I want to get a value of a custom field, now I have to use custom_xx, like this:

$result = civicrm_api3('Contact', 'getvalue', [
   'return' => "custom_11",
   'id' => 123,

As return I'd like to use the name of field (civicrm_custom_field.name) instead of id. Is it possibile?


1 Answer 1


You can use api 4 if you want to use as the name

$contacts = civicrm_api4('Contact', 'get', [
  'select' => [
  'where' => [
    ['id', '=', 123],

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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