Query Key Values

I currently have a data table that that uses key/values similar to this: 

 

param_table{

id,

taskId,

key,

value

}

row1 {

1,

123,

"string",

1

}

 

row2{

2,

123,

"string2",

2

}

 

I need to return taskId based on key{string,string2} & value{1,2}. What would be the best way to do this? 

  Discussion posts and replies are publicly visible

Parents
  • Hi,

    Use a!queryentity to get taskid,

    a!queryEntity(
    entity: entity constant,
    query: a!query(
    pagingInfo: a!pagingInfo(
    startIndex: 1,
    batchSize: 1
    ),
    filter: a!queryFilter(
    field: "key",
    operator: ="=",
    value: ri!keyName
    )
    )
    ).data.value


    or you can use selection as well:

    a!queryEntity(
    entity: entity constant,
    query: a!query(
    pagingInfo: a!pagingInfo(
    startIndex: 1,
    batchSize: 1
    ),
    selection: a!querySelection(
    columns: a!queryColumn("Value")
    )

    filter: a!queryFilter(
    field: "key",
    operator: ="=",
    value: ri!keyName
    )
    )
    )

    Regards
    Abhay
Reply
  • Hi,

    Use a!queryentity to get taskid,

    a!queryEntity(
    entity: entity constant,
    query: a!query(
    pagingInfo: a!pagingInfo(
    startIndex: 1,
    batchSize: 1
    ),
    filter: a!queryFilter(
    field: "key",
    operator: ="=",
    value: ri!keyName
    )
    )
    ).data.value


    or you can use selection as well:

    a!queryEntity(
    entity: entity constant,
    query: a!query(
    pagingInfo: a!pagingInfo(
    startIndex: 1,
    batchSize: 1
    ),
    selection: a!querySelection(
    columns: a!queryColumn("Value")
    )

    filter: a!queryFilter(
    field: "key",
    operator: ="=",
    value: ri!keyName
    )
    )
    )

    Regards
    Abhay
Children
No Data