get_table_rows

The get_table_rows method retrieves rows from a specified table in a given smart contract on the EOS blockchain. It is essential for developers and users who need to interact with and analyze the data stored inside smart contract tables. The method provides multiple filtering options, ensuring flexible and precise data querying.

Example use cases:

Smart Contract Data Interaction
Developers may find this method critical for interacting with the data within the tables of a smart contract, allowing for effective management and analysis of stored data.

Detailed Data Analysis
Users can employ this method to conduct detailed data analysis, which is pivotal for optimizing data use in smart contracts and enhancing functionalities.

Enhanced Query Flexibility
The diverse filtering options of this method enable the querying of specific data according to user needs, ensuring efficient and effective data retrieval and interaction.


Parameters

The getTableRows method requires the following parameters in the request body:

parameter
type
description
code
string (required)
Name of the smart contract that controls the table.
table
string (required)
Name of the table to query.
scope
string (required)
The account to which the table data belongs.
indexPosition
string
Index position to query (primary, secondary, tertiary, ... up to tenth).
keyType
string
Type of key used by the selected index (e.g., uint64_t or name).
encodeType
string
Encoding type used.
lowerBound
string
First element not less than the provided value.
upperBound
string
First element greater than the provided value.
limit
integer (default: 10)
Limits the number of results.
reverse
boolean (default: false)
Whether to return results in reverse order.
showPayer
boolean (default: false)
Whether to show RAM payer for each row.

Return Object

The get_table_rows method typically returns an object containing the requested rows from the specified table associated with the provided smart contract.

field
type
description
rows
array
An array containing the table rows returned by the query.
more
boolean
Indicates whether more rows exist beyond the returned limit.
next_key
string
The key to use for fetching the next page of results.

JSON-RPC Request Example

get_table_rows Request

Response Example
get_table_rows Response

Share on
Share on FacebookShare on XShare on LinkedIn
Did you find this page useful?