IF Current Row = 1 and Current Row + 1 > 1

I have an excel with more than 100 products.
In Column A I have numbers that indicate if its a complete new product or if its a similar product.

When CurrentRow in Column A = 1, then we are talking of a new product.
When The subsequent row is 2 or >1, then we are talking of similar prodcuts.
When The subsequent row is 3 or >1, the we are still talking of a simiar product.

Finally when the Current Row meets a 1 again, we are takling of a new product.

With that info I intend to do the following:

  1. If CurrentRow = 1 and CurrentRow + 1 = 1, then we are talking of a unique product, so then we will go to link in Column C, get link, use browser take screen shot and paste in Power Point with “Templeate 1”.

  2. If CurrentRow = 1 and CurrentRow + 1 > 1, then we are talking of a product with similar products, so then we will get link in Column C, use browser, take screen shot and paste in Power Point using “Templeat 2”.

So my problem is more with the logics of how to express:

CurrentRow and a CurrentRow +1

Hi

Could you share some screenshot of your Excel File to help understand your requirements

Sure!!

So every time in column number that we have a 1, it means we have new product.
If after the 1 we have a number over 1 it means we have a similar product, so in the power point we will paste both products in the same slide.

In the example of Glass of Wine we have a 1 and the row right below it is aslo a 1, so we know we only have one example of that product so in the power point in that slide we will only paste 1 product.

In the example of the shoe, it has a 1 and below it it has a 2, a 3, and a 4.
The links 2 and 3 are bad, so it will use the number 4 cool shoe that has a good link, and will paste both products on the ppt.

Then finally at the end we have a 1 and a 2 with good links , so that slide will also have 2 products.

Hi

You can use For Each Row in DataTable activity to loop your rows then use IF activity to check the Number before pasting the product.

The logic is, you only past the product in a new slide (move on to a new slide) if Number = 1, otherwise you past the product in currently slide

Hey, if I’m understand your question correctly, you are facing issue in differentiating the Product. if It is new or already existing one.
In this case you can follow this step.
Create & Initiate List or Dictionary
• For each row

  1. Add processing product in List or Dictionary
  2. Check List / Dictionary contains the Product.
    Yes: Apply logic
    No: Apply different logic

Hi @Favarelaa ,
You need compare current row with the previous row?
Have you tried by index
eg:
dt.rows(index)(1).toString <> dt.rows(index-1)(1).toString
regards,

1 Like

@Favarelaa Have you had solution,
You can send me file sample
I will help you in detail
regards,