Hi Team,
Can anyone please suggest, I am facing an issue while clicking an on screen datatable which appears on web page. please suggest me how to do it.
lets take an example which looks like below.
I need click on the ACK based on latest date which is shown under column “Finalized Date” from the current date. please suggest me how to do it.
Status Finalized Date Amount
ACK 8/21/2023 $1234
ACK 8/22/2023 $3112
Hi @suryasuhas527 ,
You can share image about screen where you select?
It’s dropdown or calendar bar…
I think can use dynamic value with date time now to select
regards
If you have a datatable which you have already extracted, then using
-
dt.AsEnumerable.Where(Function(row) row("Finalized Date").ToString.Equals(dt.AsEnumerable.Max(Function(x) x("Finalized Date")))).Select(Function(x) x("Status").ToString).First
→ To get status of row with latest date
-
dt.AsEnumerable.Where(Function(row) row("Finalized Date").ToString.Equals(dt.AsEnumerable.Max(Function(x) x("Finalized Date")))).Select(Function(x) x("Amount").ToString).First
→ To get amount of row with latest date
Store the above two in a variable and edit the selector aaname or inner text to be set as status and amount variable using ui explorer
Hi @suryasuhas527
get latest date in DT
Syntax :
Str Latest = DT.AsEnumerable.OrderBy(Function(r) Cdate(r(“Finalized Date”).ToString)).First.item(“Finalized Date”)
To check the latest item in DT
Syntax :
Boolean Variable :
DT.AsEnumerable.Any(Function(r) r(“Finalized Date”).ToString.Equals(Str_Latest))
To get Index of that file
Idx = DT.AsEnumerable.ToList.FindIndex(Function(r) r(“Finalized Date”).ToString.Equals(Str_Latest))
Pass the idx value to Click so that bot will go and click the specific file in the DT
Hi @Dinesh_Guptil ,
DT.AsEnumerable.Any(Function(r) r(“Finalized Date”).ToString.Equals(Str_Latest)) this needs to be in Boolean variable…?
Idx = DT.AsEnumerable.ToList.FindIndex(Function(r) r(“Finalized Date”).ToString.Equals(Str_Latest))----> Here what will be the data type of IDX here
could you please suggest
hi @suryasuhas527
DT.AsEnumerable.Any(Function(r) r(“Finalized Date”).ToString.Equals(Str_Latest)) this needs to be in Boolean variable…?
DataType = Boolean
For Idx Datatype = Int32
I Assume that you are trying to click on ACK on a web page based on the finalized Date (Click the finalized date if it is current date).
One way is to use get text activity (Use it get the text value in the finalized date and store it in a variable of type String ex:var:textValue),Then use assign activity to get the current date(DateTime.now.tostring(“dd/MM/yyyy”) store it in a string variable ex:var:DateValue)
If : textValue.Equals(DateValue)
click :ACK(in the selector panel edit aname as variable(DateValue) which will enable you to click the ack corresponding to the current date)
Hope you Find it Helpful !
Happy Automation!