Skip to main content
Version: main

List table records

Overview

Retrieves multiple records from the specified table.

Path parameters

NameDescription
tableThe table name for the operation.

Optional query parameters

NameTypePossible valuesDescription
DisplayValuetableapi.DisplayValuetableapi.DisplayValueTrue, tableapi.DisplayValueFalse, or tableapi.DisplayValueAllDetermines the type of data returned, either the actual values from the database or the display values of the fields.
ExcludeReferenceLinkboolN/AFlag that indicates whether to exclude Table API links for reference fields.
Fields[]stringN/AList of fields to include in the response.
QueryNoDomainboolN/AFlag that indicates whether to restrict the record search to only the domains configured for the logged in user.
Viewtableapi.ViewViewDesktop, ViewMobile, or ViewBothUI view for which to render the data.
LimitintN/AMaximum number of records to return.
NoCountboolN/AFlag that indicates whether to return the number of rows in the associated table.
OffsetintN/AStarting record index for which to begin retrieving records.
QuerystringN/AEncoded query used to filter the result set.
QueryCategorystringN/AName of the category to use for queries.
SuppressPaginationHeaderboolN/AFlag that indicates whether to remove the Link header from the response.

Required query parameters

N/A

Examples

package main

import (
"context"
"fmt"
"log"

servicenowsdkgo "github.com/michaeldcanady/servicenow-sdk-go/v2"
tableapi "github.com/michaeldcanady/servicenow-sdk-go/v2/tableapi"
)

func main() {
// Step 1: Create credentials
cred := credentials.NewBasicProvider("{username}", "{password}")
// Step 2: Initialize client
client, err := servicenowsdkgo.NewServiceNowServiceClient(
servicenowsdkgo.WithAuthenticationProvider(cred),
servicenowsdkgo.WithURL("https://{instance}.service-now.com"),
)
if err != nil {
log.Fatal(err)
}
// Step 3: Configure request
listConfig := &tableapi.TableRequestBuilderGetRequestConfiguration{
QueryParameters: &tableapi.TableRequestBuilderGetQueryParameters{
// Optional configurations
},
}

// Step 4: Execute request
listResponse, err := client.Now().Table("{TableName}").Get(context.Background(), listConfig)
if err != nil {
log.Fatal(err)
}
}
Was this page helpful?