Unable to Retrieve company.parent.sys_id via REST API

u-tec
Tera Contributor

Hi,
I'm using the Table API to retrieve hardware asset data from the alm_hardware table. Most fields are returned correctly, but I can't seem to get the value of the company.parent.sys_id field. Other fields like company.sys_id return as expected.

  • I’ve specified the field in sysparm_fields like so:
    ...&sysparm_fields=company.sys_id,company.parent.sys_id

Is there a known limitation or workaround for accessing this nested reference field?
Any guidance would be appreciated!

Thanks in advance.

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@u-tec 

the API user you are using might not have read access to the parent field on core_company table

Hence the issue.

Check this and see which ACL is blocking and give correct role to your API user.

If my response helped please mark it correct and close the thread so that it benefits future readers.

 

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

5 REPLIES 5

Chaitanya ILCR
Kilo Patron

Hi @u-tec ,

I tried this in my pdi

you can just mention the fields (company,company.parent) those will retrieve the sys_id value you don't have to dot walk further to retrieve the sysid 

 

that's not the issue here

 

are you getting the result containing (company.parent.sys_id) as a key? and value as empty?

that means the company's parent info is empty

ChaitanyaILCR_0-1750991077544.png

 

if the data is present you will get the value too (are you at least getting "company.parent.sys_id" as a key in the response?) 

ChaitanyaILCR_1-1750991307826.png

 

may be there is any ACL on parent field on the company table(check that one too)

 

try this in the rest api explorer

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya

 

 

Hi Chaitanya,


Thanks for your insights!
I just wanted to clarify that I'm calling the Table API via a Java backend, not using PDI or the REST API Explorer.
Even though I specify "company.parent" in the sysparm_fields parameter, the field does not appear in the API response at all—not even as a key with an empty value.
I confirmed that the company field itself is included, but company.parent is completely missing from the JSON result.
Given this, I'm wondering if there's an ACL issue on the parent field of the core_company table. I'm going to investigate that further.
Appreciate your help and suggestions!
Regards,

Ankur Bawiskar
Tera Patron
Tera Patron

@u-tec 

the API user you are using might not have read access to the parent field on core_company table

Hence the issue.

Check this and see which ACL is blocking and give correct role to your API user.

If my response helped please mark it correct and close the thread so that it benefits future readers.

 

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi,
After assigning the appropriate role to access the core_company.parent field, the value is now returned successfully in the API response.
Thanks for the support!
Best regards,