Using Morph Data
getJson()
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.
index.mdx
Return Value of getJson()
The return value of getJson()
has the following structure
response
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.
index.mdx
The content enclosed in
{}
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.
index.mdx