JS Data
Data is the driving force behind your app. Integrate your custom JavaScript code with the web services in your app using these functions.
Get Recordsβ
Get all records of a webservice by specifying the name and (when required) parameters of a webservice block to fetch the records for. Optionally the records for the current webservice (that is, the closest one to the current block) can be fetched by not specifiying any name. For example, to fetch all records of an Excel block that is the parent of the block running your code you simply call getRecords()
.
Argumentsβ
variableName
String
-
parameters
String
-
Exampleβ
Example if using a data block with products in it. You can simply use your favorite JavaScript framework.
Errorsβ
Here is a list of errors that can be thrown when calling this function in addition to generic errors:
INVALID_ARGUMENT
The specified variableName
doesn't reference a webservice block.
An parameter in parameters
is not valid for the webservice.
WEBSERVICE_ERROR
The remote server returned an invalid result or the result could not be parsed.
MISSING_CONTEXT
The variableName
parameter is missing and the current block is not in a data context.
Get Current Recordβ
Get the record that is currently selected. For instance, if your code is running in a block that is the child of a list block (e.g. an Excel block) getCurrentRecord()
will return the data item of the list item that the user selected in the previous screen.
Exampleβ
Example if using the data showing a "detail" page.
Errorsβ
Here is a list of errors that can be thrown when calling this function in addition to generic errors:
MISSING_CONTEXT
The current block is not in a data context.
Last updated