Read data from the “ListAccount” file to get the list of accounts.
For each account in the list: a. Read data from the CSV file. b. Read images from the “Image” folder. c. Generate a circle pivot graph based on the data from the CSV file. d. Fill the Excel template with data from the CSV file, images, and the generated pivot graph. e. Save the filled Excel template with a name according to the account’s “Subaccount” column.
Repeat the process for each account in the list.
Here’s a more detailed breakdown of the steps:
Use the “Excel Application Scope” activity to open the “ListAccount” file.
Use the “Read Range” activity to read the data from the “ListAccount” file into a DataTable variable.
Use a “For Each Row” activity to iterate through each row in the DataTable variable obtained in step 2.
Within the loop, perform the following actions: a. Read data from the CSV file using the “Read CSV” activity. b. Use the “Directory.GetFiles” method to get the list of image files in the “Image” folder. c. Use the “Excel Application Scope” activity to open the “Excel Template” file. d. Fill the Excel template with data from the CSV file using the “Write Range” activity. e. Insert images into the specified columns using the “Add Image” activity. f. Generate the circle pivot graph based on the data from the CSV file. g. Paste the generated pivot graph into the specified range in the Excel template. h. Save the filled Excel template with a name according to the current account’s “Subaccount” column. i. Close the Excel application instance.
Repeat the loop for each row in the “ListAccount” file.
It’s important to handle exceptions and errors appropriately, such as checking if files exist before attempting to read or write to them, handling empty data gracefully, and logging any errors encountered during the process.
This workflow can be built using UiPath Studio by dragging and dropping activities from the activities panel and configuring their properties accordingly. Additionally, you may need to use variables, conditionals, loops, and other control flow activities to implement the logic described above.