For each in data table

Hi ,

I have a automation scenario where I need to check if the attached files name contain “SOW” or “OF” or “Order Form”.

If then check the latest date and download if not then download all the files.

I have extracted the table in a data table and using for loop I am checking the condition. But what error I am facing is
if the first row does not match the condition ,

it goes to else block and download all the files . But it should download all the files when all the line item does not match the condition but here if the first row is not matching it goes to download all files.

How to achieve this condition

@marina.dutta

  1. Create a boolean variable and set to false
  2. use your loop
  3. inside loop on then side set to true
  4. now outside loop check if boolean is true or false…if false then start download

cheers

@Anil_G

  1. now outside loop check if boolean is true or false…if false then start download

This should be on the else side? of If loop?


@marina.dutta

As you are going download the files when the condition is false, then it should be on the else side

@marina.dutta

on else you should set true

and outside loop check that bool again

cheers

@marina.dutta

Sry please ignore my precious comment…then side set to true and outside loop if false means no match at all so downlad all

Cheers

@marina.dutta

Is the issue resolved with the logic?

Cheers

@Anil_G

Yes its resolved. Marked the solution

@marina.dutta

Do you mind closing this topic please…

Cheers

@Anil_G

Already I did.

1 Like

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