Table API to get data from /table/definition_instance

tableauwdc
Giga Contributor

Hi, I'm using the Table API to get data from /table/definition_instance, it's working fine but the field "business duration" has no values in any row.

If I check the data in the Service Now application I can see the values.

Any idea? can I check anything else?

Thanks,

Guillermo

1 ACCEPTED SOLUTION

Yes, now it makes sense that we've been dealing with two separate tables and the Business Duration field in the Metrics table was never populated.



Would you mark replies as Answer / Helpful as appropriate. Thanks.


View solution in original post

13 REPLIES 13

drjohnchun
Tera Guru

Can you try running



https://instance.service-now.com/api/now/v1/table/task?sysparm_query=business_duration>1970-01-01&sy...


on your instance? You can just put it in the URL bar in the browser and it should return the first 10 records with non-zero business_duration in both raw and display values in JSON. You may change "task" to the table you're using. Please note that "business_duration" has an underscore.



Hope this helps.



Please feel free to connect, follow, mark helpful / answer, like, endorse.


John Chun, PhD PMP see John's LinkedIn profile

visit snowaid


ServiceNow Advocate

Winner of November 2016 Members' Choice Award


Hi, thanks for your answer.



When I add the "sysparm_query=business_duration>1970-01-01" paramater to the metric_instance query I have the no record found response



https://instance.service-now.com/api/now/v1/table/metric_instance?sysparm_query=business_duration>19...



{


  "error": {


      "detail": "Records matching query not found. Check query parameter or offset parameter",


      "message": "No Record found"


  },


  "status": "failure"


}


That may be because you don't have any values in the business_duration field. Did you mean to use the duration field instead?



Can you try running



https://instance.service-now.com/api/now/v1/table/metric_instance?sysparm_query=duration>1970-01-01&...


UPDATE: corrected "task" to "metric_instance" in the link


In the ServiceNow UI I can see the values of business_duration y some row of metric_instance, but when I use the API to get the data, the values are empty.


I retrieve rows asking for "duration" but not for "business_duration", in the ServiceNow UI I can see values in both fields.