Showing results for 
Search instead for 
Did you mean: 

How to use a dynamic array from JS Rules as target for MDK ObjectTable

0 Kudos


We are developing an application were we needed to user crated data in an JavaScript array , and we want to save that data after user confirmation.

Is it possible to use an JavaScript array as ObjectTable target ?

Accepted Solutions (1)

Accepted Solutions (1)

Product and Topic Expert
Product and Topic Expert
0 Kudos

Yes, you can use a data from an array as the source for an object table. The array should contain json objects. You will have to type in the binding names since the object browser won't have knowledge of the rule contents.

Here is an example rule and object table consuming it. You could also set the binding object to the array before navigating to the page and bind off the default object as an alternative.


 * Describe this function...
 * @param {IClientAPI} context
export default function GetObjectTableData(context) {
    let data = [];

    let item1 = {
        'title': 'First Item',
        'desc': 'My generated data item #1',
        'status': 'New'

    let item2 = {
        'title': 'Second Item',
        'desc': 'Another generated item',
        'status': 'New'

    return data;

Object Table

    "_Type": "Section.Type.ObjectTable",
    "Target": "/SalesOrder/Rules/GetObjectTableData.js",
    "_Name": "SectionObjectTable0",
    "Visible": true,
    "EmptySection": {
        "FooterVisible": false
    "ObjectCell": {
        "ContextMenu": {
            "Items": [
            "PerformFirstActionWithFullSwipe": true
        "Title": "{title}",
        "Subhead": "{desc}",
        "Footnote": "{status}",
        "DetailImageIsCircular": false,
        "PreserveIconStackSpacing": false,
        "AccessoryType": "none",
        "Selected": false
    "DataPaging": {
        "ShowLoadingIndicator": false,
        "PageSize": 50
    "HighlightSelectedItem": false,
    "Selection": {
        "ExitOnLastDeselect": true,
        "LongPressToEnable": "None",
        "Mode": "None"

Hi bill.froelich,

I have used the above approach. It's working but the search is not working. Any idea?
Thanks in advance !!

Product and Topic Expert
Product and Topic Expert

The built in search mechanisms work by generating filter criteria for an OData query. Since you are targeting the table to a static array if you want to support search you will need to implement that within a target rule. Please see this answer for an example.

Answers (0)