getJson()
The getJson() function was deprecated in v0.1.0; a loadData() function with functionality equivalent to getJson() will be provided in v0.1.1.
Until then, you can declare and use functional components as an alternative.
The getJson()
function is one of Morph’s data retrieval functions; if the process specified by alias is SQL or a Python function that returns a DataFrame, you can retrieve the result in JSON format.
Return Value of getJson()
The return value of getJson()
has the following structure
data.data
contains the results of executing Python functions and SQL files.
Displaying the return value of getJson()
The return value of getJson()
is not a simple object, so you need to use the value()
function to extract the value.
{}
is evaluated as a JSX node and must be either a string, boolean, number, null, undefined, or React component. Here, we use JSON.stringify()
to stringifyUsing variables with getJson()
You can use variables with getJson()
to pass parameters to SQL queries and Python functions.