Read excel by file config?

I want to read and write excel by using template excel as below.

In file input have 11 column follow by config.
I want write file output 2 sheet (Report,Detail)

Sheet report and Sheet Detail : I want delete row that dup Name by keep only max amount (in same Name)

Sheet Report : I want write 3 column.
By use column from file input (In_ColName , In_IssueDate , In_Paid)

Sheet Detail : I want write 5 column.
By use column from file input (In_ColName , In_ColNickname , In_Amount , In_IssueDate , In_Amount)

File as attached :

config.xlsx (9.4 KB)
input.xlsx (9.1 KB)

output.xlsx (9.6 KB)

Remark​ : in​ future​, It have change name, add new rows in file​ config, But I want to.change in​ code.

Thank you

@Ramya_K Can​ you​ guide​ me​ this​ case?

1 Like
  1. Create a variable named dic_config and change the variable type to Dictionary.
  2. Using the Assign activity, assign dic_Config = new Dictionary(of String, object) .
    image
  3. Create a new variable named strAr_configSheets. Change the variable type to IEnumerable. Finally, in the Default field, type {“ExcelSheetName”}.
  4. Use the For Each activity and set the sheet in strAr_configSheets.
    image
  5. Create a new variable of type strign changed named str_ConfigFile and define the file path in the default field.
  6. Read Excel with the Read Range activity.
    6.1) Write the Excel sheetname name.
    6.2) Write the variable you assigned the Excel file path to. E.g. str_ConfigFile
    6.3) If there is a header in the config excel, mark it, if not, uncheck it.
    6.4) Write an output value to use in subsequent activities.
    image
  7. Make the settings as follows using the For Each Row activity.
    image
  8. You can assign the information read from excel to variables by using the multiple assign activity outside of the For Each activity. Example: str_ColNo = dic_Config(“In_ColNo”).ToString
    image
    Example files:
    Config.xlsx (9.2 KB)
    Config_Main.xaml (10.9 KB)
1 Like

@ridvanucok I have a question.

How write data to file output from multiple assign?

Are you trying to write the variables we assigned to different sheets in excel?

@ridvanucok Can you guide me about write the variables we assigned to different sheets in excel?