Interact with table data in a ServiceNow instance
-
- UpdatedAug 1, 2024
- 3 minutes to read
- Xanadu
- Developer guides
The Mobile SDK enables you to interact with data in tables that reside on your ServiceNow instance. You can interact with this data through the ServiceNow REST Table API using the NowTableService() API that directly calls the REST interface, or through the NowGraphQLService() API that executes a specified GraphQL query against the REST GraphQL API.
If you want to return data from multiple tables within a single call, you will need to use the NowGraphQLService() API. If you need to interact with ServiceNow REST APIs other than the Table API, see Interact with the public REST API on a ServiceNow instance.
Using NowGraphQLService to interact with ServiceNow tables
The NowGraphQLService class provides methods that enable you to construct and execute GraphQL queries on a specified table within your ServiceNow instance if the logged in user has the proper authorization. You can define all CRUD operations within your GraphQL query.
Using NowTableService to interact with ServiceNow tables
The NowTableService class provides methods to perform CRUD operations on the records
in tables that reside on your ServiceNow instance. Through this
interface you can directly access any of the records within any ServiceNow table for which the logged in user is authorized.
NowTableService supports dot-walking for reference fields. For example,
if a table contains a reference to the User table, the dot-walked value
user.name
returns the name of the user.
When returning the requested data, all applicable Access Control Lists (ACLs) are applied to the data, which may result in fewer results than expected, or authorization errors if the authenticated user does not have access rights to the specified table.
For additional code examples using the available NowTableService methods, refer to the NowTableService API documentation.