1

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?

Thanks.

1

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

$contacts = civicrm_api4('Contact', 'get', [
  'select' => [
    'constituent_information.Most_Important_Issue',
  ],
  'where' => [
    ['id', '=', 123],
  ],
]);

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.