How to return values from join

Hi All,

I have Employee, Gender[Static Entity]  and Department [Static Entity] and I associate it in Employee Entity. It is showing proper Gender and Dept in my aggregate but how to return it 


Above is my aggregate


On my Interface when i try to show Gender or Dept it shows 1,2.... 

I want to display Male, Female, IT....


Hi SP_India,

The best approach which I would suggest is.. Do some changes in GetAllEmployees API method Signature i.e.

  • Instead of defining the GetAllEmployees API method Output parameter as Employee Entity List type --> introduce a custom Structure with required attributes i.e. with addition to all the Employee Entity attribute + DepartmentLabel + GenderLabel + ....
  • In the GetAllEmployees API method definition action flow, append the GetEmployeesWithDeptAndGender Output result-Set to the method Output parameter along with DepartmentLabel, GenderLabel etc...
  • As this is a mobile application screen - Within the Screen scope, you will have to introduce the Data Source Action calling the GetAllEmployees API method with Output parameter of Custom Structure List type
  • Within the Screen scope, from the DataSource Output List, you will have the Department, Gender etc Label value for all the employee records, which you can further refer in the expression widget.


Hope this helps you!


Regards,

Benjith Sam

Benjith Sam wrote:

Hi SP_India,

The best approach which I would suggest is.. Do some changes in GetAllEmployees API method Signature i.e.

  • Instead of defining the GetAllEmployees API method Output parameter as Employee Entity List type --> introduce a custom Structure with required attributes i.e. with addition to all the Employee Entity attribute + DepartmentLabel + GenderLabel + ....
  • In the GetAllEmployees API method definition action flow, append the GetEmployeesWithDeptAndGender Output result-Set to the method Output parameter along with DepartmentLabel, GenderLabel etc...
  • As this is a mobile application screen - Within the Screen scope, you will have to introduce the Data Source Action calling the GetAllEmployees API method with Output parameter of Custom Structure List type
  • Within the Screen scope, from the DataSource Output List, you will have the Department, Gender etc Label value for all the employee records, which you can further refer in the expression widget.


Hope this helps you!


Regards,

Benjith Sam

 I made the changes like below



But when I request it from POSTMAN it returns me only single record


 

Hi SP_India,

I guess you won't be requiring the Order and Is_Active attribute value in your UI Interface...

Define the GetAllEmployee API method Output Parameter datatype Employee Structure simple as shown below and make sure that the Output Parameter is Of List Type 

Hope this helps you!

Regards,

Benjith Sam

Benjith Sam wrote:

Hi SP_India,

I guess you won't be requiring the Order and Is_Active attribute value in your UI Interface...

Define the GetAllEmployee API method Output Parameter datatype Employee Structure simple as shown below and make sure that the Output Parameter is Of List Type 

Hope this helps you!

Regards,

Benjith Sam

 I made this changes :


1] 



2] Still I get single record 



 


3] And when I drag I drop "GetEmployees" I get the record. But I try to use List widget it asks me for Source



So above list I dragged it from GetEmployees. Here also I get single record as I got  using API

Solution

Hi SP_India,

As per the below Assign node screenshot, it clearly states that the EmployeeList Output parameter i.e. LHS Variable is still a Record Type Variable 

Set the Output parameter (i.e. EmployeeList) to List type Variable

Record/Structure Type --> can only hold Single Record of structure type

List Type ---> can hold Multiple/Set/Collection of Records of structure type

 

Hope this helps you!


Regards,

Benjith Sam

Solution

Yes, it is working now. I always skipped something which is most imp. 

Thanks once again




SP_India wrote:

Yes, it is working now. I always skipped something which is most imp. 

Thanks once again

You are welcome :)

Happy that you got it solved!


Regards,

Benjith Sam