How to Add Custom Headers to an Excel File Created Dynamically in UiPath?

Hi All,

I’m currently working on a workflow where I need to create a new Excel file for today’s date dynamically. In this new Excel file, I need to generate a report of transaction items present in a Queue.

Here is what I have so far:

  • I can update the Queue and append data to the Excel file using the Append Range activity.

However, I am struggling with the following:

  • I want to add custom headers to the new Excel file, where data is getting appended row by row.
  • I am not using the Read Range activity anywhere because my data comes directly from the Queue.
  • I need to add the column names dynamically only once for the entire process.

How can I ensure that the headers are created one time, and once they are added, only the other activities should run?

Thank you for your help!

for reference:

Hi @Avyan.Sharma

If the transaction item =1
then write range
Else
Append range

Hope it helps!!

@Avyan.Sharma,

Add column headers at Build DataTable activity by checking if datatablevariable is nothing

Thanks,
Ashok :slight_smile:

Hi @ashokkarale

how to add headers from build data table, because my performer will append it every time, so everytime wont the headers be created ??

i want only one time in the process.

image
it doesn’t have anything in properties to set ?

@Avyan.Sharma

Use If after the add data row and give below

If the transaction Number =1
then write range
Else
Append range

Hope it helps!!

1 Like

@Avyan.Sharma,

If you are using REFramework then you can add this headers in Init state, First Run.

Thanks,
Ashok :slight_smile:

1 Like

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