Join data sets

Reference Entities in Read-operation

Initially look what are predefined reference entities linked to main entity.

Reference entity not included in Entity?

  • Do multiple requests and join with Flow script (shown below) or

  • Is it possible to add reference to Entity using IFS Entity Configuration feature or

  • create a Custom Entity as a new Projection in IFS and if it is possible to add the needed reference entities or

  • explore possibilities provided by Quick Reports or Query Builder to build new custom projections.

Join Entity Sets in flow

In Flow 6.15 a Flowscript Join function was introduced. Use this instead of the loop in the code example.

If several requests are necessary to get the data for the dataset, Flow script can be used to to join data into single Flow table.

Example script to join previously read Customer and CustomerAddress entitysets.

The script works on any OData machine step output data structure, you just need to replace the key values in the script.

customers = outCustomer.Results;
let addresses = outRefCustomerAddresses.Results;
let customerRecEmpty = Empty(outCustomer.Results).FirstOrEmpty();
let adddressTabEmpty = Empty(addresses);
let outTab = empty(*[customer: customerRecEmpty, addresses: adddressTabEmpty]);

for customer in customers {
 let addressesTempTab = addresses where CustomerId = customer.CustomerId;
 set outTab = outTab & [customer: customer, addresses: addressesTempTab];
 set addresses = addresses except where CustomerId = customer.CustomerId;  
 }

Last updated