DistinctFields issue - no values being returned for a custom field

Tagged:

Currently contains 2 posts

Avatar

October 03, 2019 17:31

bmalon

Hello,

This is Bartek from DaXtra Technologies. I’m still working on integrating PCRecruiter with our products for our mutual client Morgan Hunter.

I’ve come across another issue with the API. I’m trying to retrieve a list of distinct values – I’ve managed to do so for a couple of predefined fields (Title & Status); however, the API is not returning any values for a custom field called “DesiredPosition”.

Here is the request URL:
https://www2.pcrecruiter.net/rest/api/candidates/DistinctFields?Fields=Title,Status&Custom=DesiredPosition&SessionId=<session_id>

The response is:
{
‘CustomFields’ => [
{
‘FieldName’ => ‘DesiredPosition’,
‘DistinctValues’ => []
}
],
‘PredefinedFields’ => [
{
‘FieldName’ => ‘Title’,
‘DistinctValues’ => [
{
‘count’ => 1,
‘value’ => ‘Operations Analyst and Administrator’
},
<…>
]
},
{
‘FieldName’ => ‘Status’,
‘DistinctValues’ => [
{
‘count’ => 4876,
‘value’ => ‘Employee’
},
<…>
]
}
]
}

DesiredPositions is a dropdown-type field and I can confirm that it does contain 550 values.

Am I using the wrong field name? Can you please advise on what the problem may be here? Thank you.

Kind regards,
Bartek Malon

Avatar

October 03, 2019 17:35

bmalon

Nevermind – I’ve just tried using “Desired Positions” (with a space), and it worked :)

Reply to thread