I want to rename the column/fields I am retreiving in the SELECT statement. Best way to ask this is by showing an example...
Given this select call:
$contacts = civicrm_api4('Contact', 'get', [
'select' => [ 'id', 'display_name', ],
'limit' => 5,
'checkPermissions' => TRUE,
]);
Which returns object with:
[{"id": 2983,"display_name": null },]
But what if I want to rename the 'display_name' field as something else (say 'dname'), to get a result like this:
[{"id": 2983,"dname": null },]
I tried both the following but it does not work:
'select' => [ 'id', 'display_name AS dname', ],
'select' => [ 'id', 'display_name as dname', ],
Is there a way to do this, or is it not possible with the API call?
Thanks