PrepareBefore write an item, it needs prepare this item first by these actions -

Action:Set value,

Action:Set boolean value

Action:Set itemID ( objectId )

WriteThen call "Action:Save" to save prepared item. Server will append a new item if itemID had not be assigned by "Action:Set itemID"."Condition:On save" would be triggered when saving this item successful, otherwise "Condition:On save error" will be triggered. Get object ID of saved item by "expression:LastSavedItemID".

Primary keySet parameter "Key type" to "primary key" in "Action:Set value", or "Action:Set boolean value" to assign this key to be a primary key. i.e. unique key.Then calls "Action:Save" to save this item which has primary key(s). Plugin first fetches the objectId which has these unique key(s), then overwrites it with prepared item."Condition:On save" or "Condition:On save error" will be triggered after saved, too.Primary keys also could be defined at "Primary keys" in properties table, or by "Action:Set primary keys". Multiple keys are joined by ",". For example, joining primary keys "key0", and "key1" to "key0,key1".

"Condition:On save" or "Condition:On save error" will be triggered after each item saved. Finally, "Condition:On save all" would be triggered when all items saved successfully, otherwise "Condition:On save all error" will be triggered.

Read itemsThere are some ways to read items back,

using filter to get matched items, or

using itemID (objectId) to get a specific item.

Read by filterSample capxFollows these steps to build a new filter1. Call "Action:1. New" to create a new filter.2. Call one of these actions to add filter condition,

or call "Action:2. condition" to add condition by string directly, for example

Number value comparison

AND, OR

String value comparison

Date comparison

Null comparison

3. set order of items by "Action:3. order"4. set fetched fields by "Action:4. add a key", or "Action:4. Get linked object".

Read itemsAfter build a new filter by these steps, call one of request actions to start fetching -

Pages

Action:Turn to page

Action:Update current page

Action:Turn to next page

Action:Turn to previous page

Ordered items would be divided into pages, which started from page 0 (0-based). Lines of each page is set at "Lines" in properties table.

Start from any indexOr call "Action:Load in a range" to fetch ordered items started from any index.Do not mix this action with pages type requests described at previous section.

All itemsGet all queried items by "Action:Load all queried items".This action will fetch queried items page by page (each page is 1000 lines), until lines count of received page is less than 1000. i.e. the last page.

Random itemsSample capxGet queried items by "Action:Get random queried items".This action first fetches all queried itemID (objectId) back, then pick some itemID randomly. Finally fetching items by these picked itemID. It needs at last 2 requests to get random items.Or user could get all queried items by "Action:Load all queried items", then get items randomly while received.

Retrieve items"Condition:On
received" will be triggered when received requested messages. Then uses these methods to retrieve values.

Retrieve items in for each loop"Condition:For each item" or "Condition:For each item in a range" could retrieve items in a for each loop, gets item's value by these expressions.

Expression:CurItemIndex, which is 0-based

Expression:CurItemID

Expression:CurSentAt

Expression:CurItemContent

There are 3 kinds of return value in "Expression:CurItemContent".

"Expression:CurItemContent" without any parameter, will return key-value pairs of current item in JSON string.

"Expression:CurItemContent( key )" , will return the value of a specific key, or return 0 if the key does not exist.

"Expression:CurItemContent( key, default_value )" , will return the value of a specific key, or return default value if the key does not exist.

Retrieve items by item indexGet received item by item index by "Expression:Index2ItemContent". Like "Expression:CurItemContent", there are 3 kinds of return value.

"Expression:Index2ItemContent( index, key )" , will return the value of a specific key, or return 0 if the key does not exist.

"Expression:Index2ItemContent( index, key, default_value )" , will return the value of a specific key, or return default value if the key does not exist.

ItemID and timestamp of sent could be got by "Expression:Index2ItemID", "Expression:Index2SavedTime".

Retrieve all items in JSON stringGet JSON string of all received items by "Expression:ItemsToJSON".

Read value by primary keySample capxSince an item could be retrieved by index(primary) keys in loaded items. Value of a specific field in this item could be read by "Expression:At". There are 2 formats in this expression.

"Expression:At( valueOfIndexKey0, valueOfIndexKey1, valueOfIndexKey2, .... , dataKey )", it first gets item by index keys with (valueOfIndexKey0, valueOfIndexKey1, valueOfIndexKey2, .... ) , then gets the value of dataKey, or returns 0 if the key does not exist.

"Expression:At( valueOfIndexKey0, valueOfIndexKey1, valueOfIndexKey2, .... , dataKey, defaultValue )", it first gets row by index keys with (valueOfIndexKey0, valueOfIndexKey1, valueOfIndexKey2, .... ) , then get the value of dataKey. Returns defaultValue if the target value is not found.

Remember defines index(primary) keys by at "Primary keys" in properties table, or by "Action:Set primary keys".

Read by object ID of itemSample capxCall "Action:Load by itemID" to read item by object ID."Condition:On load by itemID" will be triggered when loading success, otherwise "Condition:On load by itemID error" will be triggered. Get item fields by these expressions-

Expression:LastFetchedItemID

Expression:LastFetchedSavedTime

Expression:LastFetchedItemContent

Like "Expression:CurItemContent", there are 3 kinds of return value for "Expression:LastFetchedItemContent".

"Expression:LastFetchedItemContent" without any parameter,will return key-value pairs of fetched item in JSON string.

"Expression:LastFetchedItemContent( key ) , will return the value of a specific key, or return 0 if the key does not exist.

"Expression:LastFetchedItemContent( key, default_value ) , will return the value of a specific key, or return default value if the key does not exist.

"Action:Load by itemID" will get item by itemID directly without querying, therefor it can not assign fetched fields.

Remove itemsThere are two ways to remove items -

by itemID (objectId),

by filter.

Remove by itemIDSample capxCall "Action:Remove by itemID" to remove an item by object ID."Condition:On remove by itemID" will be triggered when removing success. Get removed itemID by "Expression:LastRemovedItemID". Otherwise "Condition:On remove by itemID error" will be triggered.

Remove by filterSample capxIt also supports removing items picked by filter.First creating a new filter described at previous section, then call "Action:Remove queried items" to remove them."Condition:On remove queried items" will be triggered when all items removed success, otherwise "Condition:On remove queried items error" will be triggered.

Items countGet filtered items count by "Action:Get items count" after build a new filter. The result is put at "Expression:LastItemsCount" under "Condition:On get items count", otherwise "Condition:On get items count error" if requesting failed.

Related objectsItems in other tables could be linked into current item of a key.

Read linked objectLinked object would not be fetched automatically, Call "Action:4. Get linked object" to force this request to read this linked object back.After read completed under "Condition:On received" or "Condition:On load by itemID", get the value of linked object by "Expression:CurItemContent", or "Expression:Index2ItemContent". "Expression:LastFetchedItemContent" by a specific key. For example.

Instance of requestDesigner could create a new instance for each request. Or place multiple rex_backendless_itemtable object for each different kind of request.

Sort or filter data at localSample capxItems read from parse could be put into rex_taffydb object by "Action:Insert JSON data" (rex_taffydb) with "Expression:ItemsToJSON" ((rex_parse_itemtable). Then user could sort or filter these items at local by this rex_taffydb object.