Hi All,
I need to perform click operation based on the condition as below:
If the input excel file column(departments) contains TPA Colo, TPA Double, EGDBravo,Physical then I need click on button:“Surgery Outpatient” and need to proceed for further scrapping part.
If the above mention departments are not present means then I need to scarp the data without clicking on “Surgery Outpatient”
Can someone please help me on this??
@Palaniyappan
@ushu
@Rahul_Unnikrishnan
@Gokul001
@geetishree.rao
@ppr
@Yoichi
@lakshman
Hello @HeartCatcher
Can you refer to the below post. This can be easily done with linq and a if condition.
linq to check whether the column contains the items and if to make the condition if exists or not.
Hi @Ray ,
Could you try this instead?
Declare an Array of Strings for the keys.
Assign->
Dt2.AsEnumerable().Select(Function(s) s("COL_KEY").ToString).Distinct().ToArray()
After that, declare a List of DataRows for checking if the condition applied populates the variable with values(directly casting it to datatable will result in error)
Assign->
Dt1.AsEnumerable().Where(Function(w) arr_colKeys.Contains(w("COLA").ToString)).ToList()
[image]
CompareDataTables.xaml (6.6 KB)
Kind Regards,
…
Hi! @HeartCatcher ,
Hope you’re doing well. Have you tried the below methods…
Take one if condition and check for those keywords if keywords found in then block use click activity.
if conditions looks like
item.eqals("TPA Colo").ToString or item.eqals("TPA Double").ToString or item.eqals("EGDBravo").ToString or item.eqals("Physical").ToString
In else part use the data scraping…
For each surround with Try-Catch in catch block mention Continue
Regards,
NaNi
ushu
(Usha kiranmai)
June 24, 2022, 12:31pm
4
@HeartCatcher Try the below steps
Read the input excel file to data table
Take if condition and write the below exp
DT.Columns.Contains("TPA Colo") AND DT.Columns.Contains("TPA Double") AND DT.Columns.Contains("EGDBravo") AND DT.Columns.Contains("Physical")
DT is the data table name
If the condition becomes True then click on Surgery Outpatient else scrape directly
The column name is department what I need to mention??
ushu
(Usha kiranmai)
June 24, 2022, 1:11pm
6
@HeartCatcher
DT.Columns.Contains("department")