loadData()
You can use the loadData()
function to retrieve the results of Python or SQL executions.
Parameters
Specify the Python or SQL name.
Specify the format of the data to retrieve.
This is the Variables object passed to Python or SQL.
In addition to arbitrary objects, you can also pass a State
defined by defineState()
.
If you pass a State
, data will be retrieved again in response to changes in the State
’s value.
Return value
A QueryState<T>
object is returned.
QueryState
is an extension of State
, and you can access the value via .value
just like State
.
The value accessible via .value
differs depending on the type
parameter.
type="json"
: An object in the following format is returned.
type="html"
: An HTML string is returned.type="image"
: A base64-encoded image data is returned.type="markdown"
: A Markdown string is returned.
The following properties and methods are unique to QueryState
that has been added to Query
:
By using refresh()
, you can trigger data retrieval again.
If you set clearCache
to true
, the query results retained on the frontend will be deleted without waiting for the data retrieval to complete.