=load( local!selectedEmployeeId, local!pagingInfo: a!pagingInfo(startIndex: 1, batchSize: 25,sort: {}), local!StartDate, local!EndDate, local!Status: "All", with( local!employees: if(or(isnull(local!StartDate),isnull(local!EndDate),isnull(local!Status)), { if(local!Status="All",rule!IM_getAllCIPUsers(),rule!IM_getCIPUsersByStatus(local!Status)) }, { if(local!Status="All",rule!IM_getAllCIPUsers(),rule!IM_getCIPUsersBySearchCriteria(local!StartDate,local!EndDate,local!Status)) } ), local!employeeDataSubset: todatasubset(local!employees,local!pagingInfo), local!data: index(local!employeeDataSubset, "data", null), a!dashboardLayout( firstColumnContents:{ a!dateField( label: "Start Date", disabled: false, value: local!StartDate, saveInto: local!StartDate, alignment: "LEFT" ), a!dateField( label: "End Date", disabled: false, value:local!EndDate, saveInto: local!EndDate, alignment: "LEFT" ), a!radioButtonField( label: "Status", choiceLabels: { "Active", "DeActivated", "All" }, choiceValues: { "true", "false", "All" }, value: local!Status, saveInto: local!Status ), a!sectionLayout( label: "Aggregate of User Activation Details", firstColumnContents: { a!textField( label: "Number of Users Activated", readOnly: true, value: local!employeeDataSubset.totalCount, alignment: "LEFT" ) } ), a!sectionLayout( label: "Summary of User Activation Details", firstColumnContents: { a!gridField( totalCount: local!employeeDataSubset.totalCount, columns: { a!gridTextColumn( label: "NBID", data: index(local!data, "nbid", {}), /* Creates a dynamic link for every item in local!data */ links: apply(a!dynamicLink(value: _, saveInto: local!selectedEmployeeId), index(local!data, "nbid", {})) ), a!gridTextColumn( label: "First Name", data: index(local!data, "firstName", null) ), a!gridTextColumn( label: "Email", data: index(local!data, "Email", null) ), a!gridTextColumn( label: "Status", data: index(local!data, "isActive", null) ) }, value: local!pagingInfo, saveInto: local!pagingInfo ) } ), if(or(isnull(local!selectedEmployeeId),contains(index(local!employees, "nbid", null),local!selectedEmployeeId)=false), {}, with( /* Replace with your rule to get the employee details */ local!selectedEmployee: displayvalue(local!selectedEmployeeId, local!employees.nbid, local!employees, {}), a!sectionLayout( label: "User Details: " & local!selectedEmployee.nbid, firstColumnContents: { a!textField( label: "FirstName", readOnly: true, value: local!selectedEmployee.firstName, alignment: "LEFT" ) , a!textField( label: "LastName", readOnly: true, value: local!selectedEmployee.lastName, alignment: "LEFT" ), a!textField( label: "Is Active", readOnly: true, value: local!selectedEmployee.isActive, alignment: "LEFT" ), a!textField( label: "Start Date", readOnly: true, value: local!selectedEmployee.startDate, alignment: "LEFT" ), a!textField( label: "Activated On", readOnly: true, value: local!selectedEmployee.activatedOn, alignment: "LEFT" ), a!textField( label: "Activated By", readOnly: true, value: local!selectedEmployee.activatedBy, alignment: "LEFT" ), a!textField( label: "Email Id", readOnly: true, value: local!selectedEmployee.Email, alignment: "LEFT" ) } ) ) ), if(or(isnull(local!selectedEmployeeId),contains(index(local!employees, "nbid", null),local!selectedEmployeeId)=false), {}, with( /* Replace with your rule to get the employee details */ local!selectedEmployee: displayvalue(local!selectedEmployeeId, local!employees.nbid, local!employees, {}), local!userGroups: rule!IM_getGroupDetails(local!selectedEmployeeId), local!userGroupsDataSubset: todatasubset(local!userGroups,local!pagingInfo), local!dataa: index(local!userGroupsDataSubset, "data", null), a!sectionLayout( firstColumnContents: { a!gridField( totalCount: local!userGroupsDataSubset.totalCount, columns: { a!gridTextColumn( label: "Groups", data: if(local!userGroups="","User is not part of any group",apply(fn!group,tointeger(local!userGroups),"groupName")) ) }, value: local!pagingInfo, saveInto: local!pagingInfo ) } ) ) ) } ) ) )