Find data on another excel file if the data is not found in the current excel file

Dear developers, I need to find data on an excel file. if the data is not in there I have to find that data from another excel. how to switch the excel file if the data is not found? hereby attached the sample workflow

I have to switch to find the data in another excel file.if the data is not in here.Your help will be much appreciated. thank you.

Do we have any column or a primary key between these two excels and if so we can go for LOOKUP DATATABLE activity
Cheers @Yusuf_Rahmaniac

Hello @Yusuf_Rahmaniac

We can do a slight change to your workflow…
After the first read range, you will be getting the data onto a datatable.

So to check whether that datatable has any data, you can use the below if condition.

DT.rows.Count > 0

If it is 0, that means you dont have data and you need to switch to the other excel. So in that section of the if condition, use the other read range activity to read the data from the other excel file.

Also, I think you can simplify this more if you use the workbook activities of the excel so that you can omit the excel application scope.

If you want to use it, the I suggest in the if condition, use a boolean variable and based on that, do the next read range below the excel application scope which is already there to make the flow simpler and easier to understand

1 Like