Hi, I have 2 entity below, each system contains multiple Sub-systems.
How can i download the excel with following format (list down the system with all sub system belongs to it with splitting by ";")
Hello,
You can't not implement this directly by using Record List To Excel widget to convert output of aggregate to excel but you can implement this either by writing SQL query that return output as you want exactly then use Record List To Excel to convert output of advanced sql to excel or you need to handle this manually by using local variable of type list of structure and loop through output of your aggregate then add condition if Id of system table exist into your local variable append subSystem to subSystem attribute then convert local variable list to excel
Hi @Giselle Chen,
Whatever scenario I have explained above, same things I implemented in the one demo application look at the attached OML.
Below I attached OML for your reference:
Hope this will help you!!
Regards,
Rajat
Hii @Giselle Chen
I’m attaching the .oml file for your reference. You can use it to better understand the implementation or to replicate the solution in your setup.
Best regards,
Rounak Rawat
Thanku
Thank you @Rounak Rawat for guiding me with the other way to achieve the function.
Welcome @Giselle Chen
You can export the data using the following query:
SELECT {System}.[SystemsName], {System}.[AssigneOfficer], STUFF((SELECT ', ' + {SubSystems}.[SubsystemName] FROM {SubSystems} WHERE {System}.[Id] = {SubSystems}.[SystemId] FOR XML PATH ('')), 1, 2, '') AS SubSystemsNameData FROM {System}
I have made the changes in the attached OML file. Please check.
Demo URL - https://vyadav.outsystemscloud.com/ExcelExport/ExcelExport
Thanks,
Vipin Yadav
Thank you @Vipin Yadav for guiding me with the sql way!
Firstly you can create of structure which contain 3 attribute System Name , System Officer ,Sub System Name and create a local variable of list structure type. after that create a comma separated string of Sub System name and assign in structure attribute.
Thank you @Rajat Agrawal for the detailed explain and sample.