Depending on the content of an excel file - insert rows

Hello friends,

Do you have any tips on how a beginner can deal with something like this?

This is my excel file:

I need a blank row between rows that are different from each other. So in this case the expected result should be:

Is there any way you could help me or give me some tips?

I’m using the StudioX version as I’m just getting into it.

Your help would be greatly appreciated.

Thank you <3

You can follow below approach:

  1. Open UiPath StudioX and create a new project.
  2. Add the necessary activities to your project. Here’s an example of how you can achieve the desired functionality:a. Use the “Excel For Each Row” activity to iterate through each row in the Excel file.b. Within the loop, use an “If” activity to check if the value in Column A of the current row is different from the previous row. You can use a variable to store the previous value and compare it to the current value.c. Inside the “If” activity, use the “Insert/Delete Rows” activity to insert a new row above the current row. Set the “Number of rows to insert” property to 1.
  3. Configure the properties of the activities as needed, such as specifying the Excel file path, setting the range for the “Excel For Each Row” activity, and defining the conditions for the “If” activity.
  4. Save and run the project.
1 Like

Hello

I’m doing that right now and I’ve got a problem.

This is my workflow.

Row variable = CurrentRow(“XXXXX”).ToString (so that I can compare it with the current row on the next loop)

The problem is that my result is:

It does the blank row in only one place and not the correct one.

This gives me confusion.

@JennZabba Let me check

1 Like

Hi,

Can you try the following sample?

NewBlankTask20230714-1.zip (66.1 KB)

Regards,

1 Like

It works thank you sir.

2 Likes

Hello

I use another StudioX version 2022 10.3 and I cannot update at the moment. I can’t open your project in this version. I’m getting an error:
image

I tried to re-write it but when I try to write this:
image
I cannot then find this System.Collections ~~ list int 32 in the properties of the variable, and the one that I can’t find don’t work. Do you have any ideas how to solve it?

@JennZabba
do you have option Browse for type
image
select variable type-> System.Colloction.Generic.List<system.Int32> then assign in Assign activity

1 Like

@JennZabba problem resolved?

Hi,

How about using CreateList activty a the following?

image

Regards,

Hi,

It seems I still cannot copy this.

I have two errors, any ideas?

How do I copy this : where it says:
image

To my old version? there is no Show advanced options.
image

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