What is GlideTableDescriptor and what is the alternative for using this in scoped application??

girishgyani
Kilo Contributor

We cloned a widget from global into our scope. After cloning the widget when we try to render the page where this widget is called it throws an error "GlideTableDescriptor is not allowed in scoped applications". We want to know exactly what this 'GlideTableDescriptor' does and what is the alternative for using this in our scoped application??

8 REPLIES 8

pr18
Kilo Contributor

Any updates on this event, I am facing the same issue.

Please advice.

 

Lewis Chi
ServiceNow Employee
ServiceNow Employee

We don't have any official documentation around API's such as “GlideTableDescriptor” and “FilteredGlideRecord”.

If it is not on https://developer.servicenow.com/, then it is very likely unsupported.

Also, the API might work in global scope, but there is a restriction at the java layer so there IS NOT a way around it. 

 

Thanks,

- Lewis Chi

ServiceNow Engineer

Afshin
Tera Expert

GlideTableDescriptor provides metadata about a table. By using the dot method, we can extract information such as field names and labels. Here are a few examples:

// Get the GlideTableDescriptor for the "incident" table
var tableDescriptor = GlideTableDescriptor.get("incident");

// Get the display name of the table
var tableName = tableDescriptor.getDisplayName();
gs.info("Table Name: " + tableName);

// Get the list of field names in the table
var fieldNames = tableDescriptor.getFieldNames();
gs.info("Field Names: " + fieldNames.join(", "));

// Get the label of a specific field
var fieldLabel = tableDescriptor.getFieldLabel("short_description");
gs.info("Field Label: " + fieldLabel);

In scoped applications, you can use the Scoped GlideRecord API to retrieve table metadata. The GlideRecord API provides methods to query and access records in ServiceNow tables, including retrieving metadata information.

edeweese
Tera Contributor