Can we put DataTable name in a variable

I’m iterating through a list and putting the data in an excel file using data tables but I want to filter data and add it in different files based on some conditions like location of a person. I want data of people who are at same location in a single file. That’s way I can have a file for each location. I want the data table name to be in a variable so that I don’t have to create new data table every time and do not need to repeat the steps of adding the data in excel because the columns and everything is same.
Really appreciate the help. :slight_smile:

@Maryum_Siddique Can you Explain the Steps that you are performing ? I guess a bit more Clarification is required as to Why you want to a Datatable Name to be in a Variable.

@supermanPunch I have data of employees working at different locations in a list. I want to make separate report in excel file for each each location. For Example, people working in USA should be stored in different excel file, people working in UK should be stored in different file and so on. I have a separate flow in which I’m building a data table and writing it in excel file. I want to pass a location name in that flow so that I can have data table for each location with the same columns. I will just change data table name in write range activity. Then I will call that flow in if condition based on location. I hope you’ve understood my process. :slight_smile:

@Maryum_Siddique Do you have a workflow built already?, Can you send it if possible?
Based on what you have told me , I guess these are the Steps you need to Follow:

  1. Read the Excel File.
  2. Generate Unique Data based on Country or Place.
  3. Loop through the Unique Data using For Each Row
  4. Use Filter Datatable Activity on the Original Datatable to get the rows of that particular Place.
  5. Use the Output of Filter Datatable in Write Range Activity to Store the Data in Excel Sheets.
1 Like