Symptom
API returns empty response when $select option is used in the URI to query from JobReqScreeningQuestion entity.
Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental.
Environment
SAP SuccessFactors Recruiting Management
Reproducing the Issue
- Perform a query on JobReqScreeningQuestion entity. For example: https://<api-server>/odata/v2/JobReqScreeningQuestion?$filter=jobReqId eq 55 &$format=json
- See that the API response contains properties present on JobReqScreeningQuestion entity:
- Now perform the same query, but add the $select operator. For example: https://<api-server>/odata/v2/JobReqScreeningQuestion?$select=jobReqId&$filter=jobReqId eq 55 &$format=json
- Notice that API response has empty result:
Cause
This behavior is expected due to system design and because JobReqScreeningQuestion entity has an internal dependency on the value jobReqContent.
Resolution
To query a select of an attribute from Odata, the URI must contain jobReqContent for the $select to work; else, it would not return proper or expected response.
For example, using the same query in the examples above, add the jobReqContent into the $select operation:
Query: https://<api-server>/odata/v2/JobReqScreeningQuestion?$select=jobReqId,jobReqContent&$filter=jobReqId eq 55 &$format=json
Result:
Note: Notice that API returns only the field present on the $select operation, that is jobReqdId, as it should. See Implementation Guide for details on how $select query option works.
See Also
KBA: 2944380 - JobReqScreeningQuestion, JobApplicationQuestionResponse and JobApplicationInterview Entity returning no data in Integration Center and OData API - Recruiting Management
Implementation Guide:
Keywords
jobReqScreeningQuestion, jobReqContent, job, req, content, screening, question, $select, operator, api, response, result, empty , KBA , LOD-SF-RCM-API , Webservices & APIs , Problem
SAP Knowledge Base Article - Public