SAP Knowledge Base Article - Public

2808267 - Query with navigation to User entity has the "userNav" field returning as null - OData API

Symptom

You perform a query which has a navigation to the User entity and the "userNav" field returns only a "null" value. Due to this, further results that would be returned about the User entity are not returned.

Environment

  • SuccessFactors
  • OData API

Reproducing the Issue

Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental.

  1. Perform a query which has a navigation to the User entity through the "userNav" field, for example a query on EmpJob:

    https://apisalesdemo4.successfactors.com/odata/v2/EmpJob?$format=json&$expand=userNav&$select=userId,location,userNav/lastName,userNav/firstName,userNav/username&$filter=userNav/userId eq '666'

  2. You get the following results:

    {
        "d": {
            "results": [
                {
                    "__metadata": {
                    "uri": "https://apisalesdemo4.successfactors.com:443/odata/v2/EmpJob(seqNumber=1L,startDate=datetime'2019-04-06T00:00:00',userId='666')",
                    "type": "SFOData.EmpJob"
                },
                "userId": "666",
                "location": "7000-0001",
                "userNav": null
                }
            ]
        }
    }

Cause

Lack of proper permissions on the API user that is performing the query.

Resolution

Check and correct the permissions which were given to the API user.

To help you, check the SAP SuccessFactors Employee Central OData API: Reference Guide. The page 20 onwards will specify the permissions required to the API user.

The KBAs described in the "See Also" section can also help on this.

Besides granting the proper permissions, be sure that API user is included in the Target Population which the Permission Role created for the permissions is pointing to:

userNav_null_1.jpg

See Also

2732680 - USER x ADMIN permission modes - SuccessFactors OData API Permissions

2635970 - How to Restrict field level permissions for API access to EC portlets/entities

2316798 - How to restrict API access to specific EC portlets/entities

Keywords

successfactors, success, factors, odata, api, call, query, null, empty, blank, value, not, return, permission, access, role, unable, get, data, edit, granting, , KBA , LOD-SF-INT , SF Integrations - EC Payroll, Boomi/ HCI, API , LOD-SF-INT-ODATA , OData API Framework , Problem

Product

SAP SuccessFactors HCM Suite all versions