remove
Description
Removes certain data from a dataset.
Input / Parameter
dataset
The name of the dataset that is created in Services.
Text
-
-
Yes
filter
The filters to be applied.
FilterFormat
-
-
No
extra
The stored value that is passed to all the callbacks.
Any
-
-
No
FilterFormat (Object)
The format used for filtering in the parameter filter
.
operator
Query operators used to filter multiple times.
Text
And
Or, And
No
data
Set of rules for another group of queries.
List
-
-
No
data (List)
Will contain a list of one (1) or more objects with the following structure (dataset, operator, value) and contain zero (0) or more objects with the same structure (FilterFormat only). This can be another FilterFormat to create grouped queries.
dataset
The dataset to filter.
Text
-
-
No
field
The field to be filtered.
Text
-
-
Yes
operator
Operators to be used for specific filtering.
Text
-
Equal, Not_Equal, Is_Null, Is_Not_Null, Greater_Than, Greater_Than_Or_Equal, Less_Than, Less_Than_Or_Equal, Like, Not_Like, In, Not_In, Between, Not_Between
Yes
value
The value to perform the query, which depends on the operator.
Any
-
-
No
Output
Returns the formatted information.
Object
Object
success
Boolean value to denote whether the function was executed successfully.
Text
message
The message to print.
Text
data
Any additional message or data to print.
Text
Callback
callback
The action performed if this function runs successfully.
Returns a boolean value if data is deleted.
Boolean
errorCallback
The action performed if this function does not run successfully.
Returns an error message.
Text
Example
In this example, we will remove an item from the local table data from their local storage.
Steps
Create a
Local Table
in the services panel in the service page if there is no table created yet. For the fields, addname
andtitle
as object key with Text type.Drag a button component to a page in the mobile designer.
Select the event
press
and drag theDataset.remove
function to the event flow and fill in the parameter. Drag aLog.write
function below theDataset.remove
function and change the parameter type of the value parameter toinput
.For the
filter
parameter, change it's type to a function / subflow and dragConversion.toObject
to the subflow. Then adddata
as an object key and change it's type to a function / subflow. and putConversion.toObject
inside it.Drag the function
Conversion.toObject
to the new subflow. Then addfield
,operator
andvalue
as object keys withname
,like
,n%
as their values respectively.
Result
The data passed should be removed from the local table.
Last updated