cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

Format of the input for the source and query fields for the QueryDataTableEntries service of the DataTable

jrajesh
7-Bedrock

Format of the input for the source and query fields for the QueryDataTableEntries service of the DataTable

Hi,

What is the format of the input for the source and query fields for the QueryDataTableEntries service of the DataTable? Please give examples.

Thanks and Regards,

Jyothi

1 REPLY 1
qngo
5-Regular Member
(To:jrajesh)

Hi,

A query example:

http://support.ptc.com/cs/help/thingworx_hc/thingworx_7.0_hc/index.jspx?id=QueryParameterforQueryServices&action=show

var query = {

    filters: {

        type: "And",

        filters: [

            {

                type: "LIKE",

                fieldName: "ID",

                value: "%" + id + "%"

            },

            {

                type: "LIKE",

                fieldName: "EntityType",

                value: entityType

            }

        ]

    }

};

The source depends on how you add entry to table. By default, it's the login username. You can check it in your DataTable / Entity Information / Home Mashup.

QueryDataTableEntries service:

var params = {

maxItems: undefined /* NUMBER */,

values: undefined /* INFOTABLE*/,

query: query /* QUERY */,

source: "A_String" /* STRING */,

tags: undefined /* TAGS */

};

// result: INFOTABLE

var result = Things[DataTableName].QueryDataTableEntries(params)

Regards,

Quang-Dung

Top Tags