Como leer los excel existentes de una carpeta, generar un solo reporte y colocar de que excel origen es la información

Buenas tardes, tengo un flujo que realiza lo siguiente, el bot entra a una ruta indicada, lee todos los archivos Excel existentes de esa carpeta y la información obtenida es agregada en un nuevo Excel, cada fila en ese reporte corresponde a la información del usuario como Nombre, Apellido paterno, Apellido materno, Empresa, Tipo de visitante y Estatus.

Ahora lo que deseo es agregar dos columnas mas a ese reporte, una que se llame “Archivo origen” y otra que se llame ”Fecha de creación” <- con esta fecha me refiero a la fecha de creación del archivo excel origen.

¿como podría hacer esto que menciono en el punto anterior? ¿Cual sería la lógica o las propiedades de carpeta que debo usar?

Así está hasta ahora:
image
esas son las columnas que deseo llenar


con esta información lo quiero agregar
image
Así debería quedar:

espero me puedan ayudar, gracias :slight_smile:

Hy @Martinez_Martinez_Gustavo,

After you read the sheet ‘Solicitud’, add the following:
Use the ‘add column’ activity to add the 2 columns you need.
Loop through the data table with the ‘for each row’ and insert the file name like this
row(“Archivo Origem”) = item (assign activity)
Get the File Creation Time
Var (System.DateTime) = new FileInfo(item).CreationTime

Then move on to the ‘Append Range’ Activity

You are almost done!! Good work

Regards

Hello William, I have done the steps that you indicate but I was not successful throws the following error

[Bot.zip|attachment]
what am I doing wrong?

Bot.zip (40.9 KB)

For greater context, the first sequence is the part that generates a single report, I describe it a little:

the Assign activity captures excel files that start with the word “SAV” and are xlsx files

For Each, each element in elementsFolder is going to do a Read Range to the sheet “Request” starting at row number 18. Capture all the elements found in an Append Range storing the information in the sheet “Usr_Sav_Totales” of a new excel called " Reporte_Bot_Contador_SAV_SFE "

sequence 2, reads that report generated in the previous step, and if it finds trust with information, it makes two filters in the report, this filtered information is stored in the same report only in different sheets that are “Reg” “No_Reg”

Sequence 3, the last step of the bot, counts all the records of each filter and the exceeds read in the folder.

Hy @Martinez_Martinez_Gustavo,

Excelent that you tried and made mistakes, thats the way to learn!

I will have a look on it and get back to you

Regards

muchas gracias!! :slight_smile:

Hy @Martinez_Martinez_Gustavo,

Your workflow was well designed and built :slight_smile:
Check it out! I have changed most of the first part, the rest remains the same.
Compare with your file.

Regards

MoveExcelFiles_Test.zip (67.2 KB)

1 Like

thank you! It works perfect, just like I wanted.

thanks again, you helped me a lot! :slight_smile:

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.