Export to Excel across different sheets ?

I'm using the exportDataStoreEntityToExcel sail function to pull data from a single table into excel...

The data I'm pulling has a location identifier for each row. Is it at all possible to write the data into excel so that data for each location is on a different sheet ?

table has 
loc1  field2 field3 field4
loc1  field2 field3 field4
loc2  field2 field3 field4
loc3  field2 field3 field4
loc2  field2 field3 field4

I'd like to get the spreadsheet to have

loc1  field2 field3 field4
loc1  field2 field3 field4

tabs :Loc1   Loc2  Loc3


  Discussion posts and replies are publicly visible

Parents
  • Likely you will want to loop over a!exportDataStoreEntityToExcel() in this scenario - first querying for the list of unique locations, {"loc1","loc2","loc3"}, then potentially utilizing a!foreach() on those locations to call the export function, with fv!item (each location) in the filters parameter, and fv!index as the sheetNumber.  Note I haven't implemented this logic with the export function, but I have done this with the Smart Service in a process model which loops utilizing the same documentToUpdate to write to different sheets.  Just some food for thought..

  • that what I thought you'd say :( 
    if we follow that pattern, doesn't it mean that we will be pinging the db for export for each location -- so 30 locations + 1 ping to get the locations listed out.

Reply Children