Extract filter data from excel

Hello Software Engineers,
Now I’m automating extract data from excel with filter and got filtered data want to show new excel.It was just three condition**(Gender is Male who is above 40 age and Address starts with Tokyo** from PersonalInformation.xlsx.Now that filtered data couldn’t show new Excel UpdatedPersonalInformation.xlsx.

I will attach my excel file.I desire to show data as attached UpdatedPersonalInformation.xlsx file.
**男 means Male

Please check out my xaml file.
Kind Regards,
PersonalInformation.zip (18.7 KB)

Hi ,

Do you mean by show new updated data, you want to write it in some other excel like that.

If so you can try write range in workbook or write to output panel using output datatable and write line.

The filter datatable would be useful instead of if condition if you are not going to alterations with remaining data.

Thank for reply.I updated Write Range Output as attachment. But I could see only Header Name. Filtered data couldn’t show.Anything problem in xaml file?

please Can I receive check?PersonalInformation.zip (18.7 KB)

And I know usage of FilterDataTAble. But I don’t want to use. I wanna try with if Condition.
Kind Regards,

Hi @Daffodil ,

There are some points where I believe a Thorough look into the Input Data is required before arriving into the Solution. Making the below changes should be able to provide you the Desired output.

  1. The variables used in the If condition are not initialised or does not have a value at the beginning.

Instead of the Variables highlighted above (strAge, strAddress, strGender), we should use the values present in the CurrentRow (DataRow Type) variable to check the values read from the Excel match a certain condition or not, as shown below :

  1. When you are using Add Data Row Activity, you are adding the Filtered Data to the dtOutput variable. Hence, the Filtered data would be present in the dtOutput and not the dtTable variable.

  2. The Correction would be to use dtOutput in Write Range Activity instead of dtTable. Also, You could keep the Excel Scope with Write Range outside the For Each Loop, as it is not needed to be present inside the loop.

Please Find the updated Workflow Below :
PersonalInformation.zip (11.7 KB)

Let us know if the above information is not clear or if the Workflow does not provide the required output.

Thanks for complete explanations. Solved it.
Kind Regards,

1 Like

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