Digital Assistant and Mobile

Get Involved. Join the Conversation.

Topic

    Zhiyu Liu
    How to get multiple rows via Database Access API in Custom...
    Topic posted February 23, 2017 by Zhiyu LiuGreen Ribbon: 100+ Points 
    17 Views, 3 Comments
    Title:
    How to get multiple rows via Database Access API in Custom Code
    Summary:
    How to get multiple rows via Database Access API in Custom Code
    Content:

    Hi Experts,

        we want to retrieve multiple rows from one table from MCS internal database, i go thru the APIs but seem just have get a row or get all rows

           database.get(table, keys, options, httpOptions): Retrieves a row from a table.

           database.getAll(table, options, httpOptions): Retrieves specified fields from all rows in a table.

        in bellowing response , we just need to get these rows ( 'employeename = owen') rather than all rows.

    {

      "items": [

        {

          "id": 2,

          "status": "PENDING",

          "description": "Zhiyu水泵保修",

          "employeename": "zhiyu",

          "createdatatime": "2017-02-21T09:51:45.699+00:00"

        },

        {

          "id": 3,

          "status": "PENDING",

          "description": "this is desc1",

          "employeename": "zhiyu",

          "createdatatime": "2017-02-21T10:01:48.612+00:00"

        },

        {

          "id": 4,

          "status": "pending",

          "description": "what's up",

          "employeename": "owen",

          "createdatatime": "2015-07-20T14:37:24.000+00:00"

        },

        {

          "id": 1,

          "status": "PENDING",

          "description": "again test",

          "employeename": "owen",

          "createdatatime": "2017-02-21T09:33:48.144+00:00"

        }

      ]

    }

    Comment