This page uses the sxc data API to get data from the backend and display it in a table with JavaScript.
In this tutorial you'll learn how to:
- Create a $2sxc object using the current Module Id
- Create a Query service using the
.query(...)
.
- Read data using
getAll()
, getStream(...)
and getStreams(...)
Note that this sample will run the query RandomAuthorWithBooks
. There are some things which you should know:
- The Query has permissions configured to allow viewers to use the query in JS.
- Each call returns a random author with his books, so sometimes the books-list may be empty