a!localVariables( /* Query the parent */ local!Employee: a!queryEntity( entity: cons!TOC_EmployeeEntity, query: a!query( selection: a!querySelection( columns: { a!queryColumn(field: "Employeeid"), a!queryColumn(field: "Departmentid"), } ), pagingInfo: a!pagingInfo( startIndex: 1, batchSize: -1 ) ), ).data, /* Query the many-to-one child */ local!Department: a!queryEntity( entity: cons!TOC_DepartmentEntity, query: a!query( selection: a!querySelection( columns: { a!queryColumn(field: "Departmentname"), a!queryColumn(field: "Departmentid"), } ), pagingInfo: a!pagingInfo( startIndex: 1, batchSize: -1 ) ), ).data, a!gridLayout( label: "EmployeeDetails", /*instructions: "Seleccionados: " & local!selected & local!selectedItems,*/ headerCells: { a!gridLayoutHeaderCell(label: "Employeeid"), a!gridLayoutHeaderCell(label: "DeparmentName", align: "LEFT") }, rows: a!forEach( items: local!Department, expression: a!gridRowLayout( id: fv!index, contents: { a!richTextDisplayField( value:{ a!richTextItem( text:fv!item.Departmentid, color: "#1a0000", size: "SMALL" )} ), a!richTextDisplayField( value:{ a!richTextItem( text:fv!item.deparmentname, color: "#1a0000", size: "SMALL" )} ) } ) ), ) )
how to join the employee and department?
Discussion posts and replies are publicly visible
Hi, you can either create a record having the relationship between these two entities or you can create a view in the database.Check the below link.
docs.appian.com/.../record-type-relationships.html
The question is not super clear. You want to join two tables but all the joining happened either in table, or in record or in the CDT. What are you trying to achieve in this expression rule?
I guess this will help you
https://community.appian.com/discussions/f/data/10454/how-to-use-a-queryentity-to-query-data-from-multiple-cdts