Hi, I am new to UIPath and I am facing the below problem :
I have two excel documents - from excel 1 I am to pick up an ID and check if it is present in excel 2. If present update a couple of columns on excel 2. But the search would be such that first I have to filter three columns in excel 2 and if only ONE record for that particular ID is present in excel 2 only then I will be updating excel 2 columns for that ID, else move to the next ID, or end the process if there is no other IDs in excel 1.
Now in my code that I have created another row is getting added in excel 2 for that ID after adding the filters, where the update is taking place. But I need to update the same row and not have another row added.
Below is my code:
In an assign activity I am putting below logic for filtering (when FilterColumn1 and FilterColumn2 are “Yes” and FilterColumn2
3 is “Blank”)
dt_OutputData.Select(“[ColumnToBeUpdated ID] = ‘ABC’”).CopyToDataTable.Select(“[FilterColumn1]=‘Yes’). CopyToDataTable.Select(“[FilterColumn2]=‘Yes’). CopyToDataTable.Select(“[FilterColumn3]= ‘“+string.Empty+”’”). CopyToDataTable
Then I am adding the below If condition:
Then update the ID columns of that row.
I am not putting the logic for the updating part here as it is working as expected if I don’t add the filter logic (the assign and IF). No second row is getting added. It is only when I put the filter logic another row is getting added and the update is happening there. So I am thinking that the issue is with the filter logic. Hope I could explain properly the issue.
Please help. This is my first question here and I have to solve this. Thanks in advance!