How can I show the data of two local variables into one grid

I am using two local variables and the data is coming via expression rules (there are multiple columns)

local!empStatus: index(rule!EO_getEmpStatus(),"data",{}),
local!empDetail: index(rule!EO_getEmpDetail(),"data",{})

I want to use the data of local!empStatus and local!empDetail into single read-only grid.

  Discussion posts and replies are publicly visible

Parents
  • Hi Ankita,

    You can try any of the code between these 2.

    load(

    local!empStatus: {{id:3,empId:1,status:"Active"}, {id:2, empId:2, status:"Active"}, {id:1, empId:3, status: "Inactive"}},
    local!empDetail: {{id:1,name:"ABC"}, {id:2, name:"PQR"}, {id:3, name: "LMN"}},
    local!empFinaldata:a!foreach(
    items:local!empDetail,
    expression:{
    id:fv!item.id,
    name:fv!item.name,
    status:index(
    index(
    local!empStatus,
    wherecontains(
    tointeger(fv!item.id),
    tointeger(index(local!empStatus,"empId",{}))
    ),
    {}
    ),
    "status",
    {}
    )
    }
    ),
    a!formLayout(
    label:"Form",
    contents:{
    a!gridField(
    label:"grid",
    data:local!empFinaldata,
    pageSize:5,
    pagingSaveInto:fv!pagingInfo,
    columns:{
    a!gridColumn(
    label:"Name",
    value:fv!row.name
    ),
    a!gridColumn(
    label:"Status",
    value:fv!row.status
    )
    }
    )
    }
    )
    )

Reply
  • Hi Ankita,

    You can try any of the code between these 2.

    load(

    local!empStatus: {{id:3,empId:1,status:"Active"}, {id:2, empId:2, status:"Active"}, {id:1, empId:3, status: "Inactive"}},
    local!empDetail: {{id:1,name:"ABC"}, {id:2, name:"PQR"}, {id:3, name: "LMN"}},
    local!empFinaldata:a!foreach(
    items:local!empDetail,
    expression:{
    id:fv!item.id,
    name:fv!item.name,
    status:index(
    index(
    local!empStatus,
    wherecontains(
    tointeger(fv!item.id),
    tointeger(index(local!empStatus,"empId",{}))
    ),
    {}
    ),
    "status",
    {}
    )
    }
    ),
    a!formLayout(
    label:"Form",
    contents:{
    a!gridField(
    label:"grid",
    data:local!empFinaldata,
    pageSize:5,
    pagingSaveInto:fv!pagingInfo,
    columns:{
    a!gridColumn(
    label:"Name",
    value:fv!row.name
    ),
    a!gridColumn(
    label:"Status",
    value:fv!row.status
    )
    }
    )
    }
    )
    )

Children
No Data