[#819] Additional field issue

Migrated from Redmine #819 | Author: Ghulam Ali
Status: New | Priority: Immediate, there is BUG! | Created: 2021-11-20


Hey, i’m trying to add addition filed (a dropdown). I have enabled intake forms and added into. I’m using company public service method book().
$additionalFields = [
‘handle_invoice’ => true,
‘LocationPreference’ => ‘online’
];
$bookingsInfo = $client->book($eventId, 1, $date, $time, $clientData,
$additionalFields, null, null, null);
I’m getting this error
“message”: “Request error: LocationPreference - ‘’ was not found in the haystack,Value is required and can’t be empty”,

Ghulam Ali wrote:

$field = $client->getAdditionalFields ($eventId);
$additionalFields = [
‘handle_invoice’ => true,
$field[0]->name => ‘online’
];
I have modified the code but still getting
“message”: "Request error: LocationPreference - ‘Online’ was not found in the haystack

Ghulam Ali wrote:

Hey, i’m trying to add addition filed (a dropdown). I have enabled intake forms and added into. I’m using company public service method book().
$additionalFields = [
‘handle_invoice’ => true,
‘LocationPreference’ => ‘online’
];
$bookingsInfo = $client->book($eventId, 1, $date, $time, $clientData,
$additionalFields, null, null, null);
I’m getting this error
“message”: “Request error: LocationPreference - ‘’ was not found in the haystack,Value is required and can’t be empty”,

Redmine Admin wrote:

you need to pass field hash, not name. please check this ticket for example Support #266: Intake forms - API - Simplybook.me support for developers