How to extract the latest data from the given values, the latest data will always provided below

If these are the values provided in SAP.
12345
67891
23452
12010
11020
from this ,if 11020 is the latest number and how can I extract that particular number form the dropdownlist. Which Activity I Can use for it.

Hi @Chippy_Kolot

Have you tried using "Select Item " Activity.

Thanks

1 Like

Hi @Chippy_Kolot,

Here you go. You have two options

  1. Use Find Children activity. This will give you Output as List<UiElement>. You can iterate trough it and apply your logic to get latest number.

  2. Use Get Attribute activity. Use "items" as attribute. You will get output as List<String>. You can iterate trough it and apply your logic to get latest number

If your last item is the latest number you can use lst(lst.Count-1)

I tried using select item activity… But it is taking entire details in that particular session i only want to fetch the datas from ABCValues, Among that 11020 is considered as latest number. But it is fetching datas from ABCDates also.No need to fetch datas from ABCDates .How can i fix that issue and also how will i select latest number from that values which were provided above…?
ex: ABCValues
12345
67891
23452
12010
11020
ABCDATES
20/06/2022
21/06/2022
22/05/2022

Hi! @Chippy_Kolot,

Please clarify the below questions

  1. How can we identify that particular number is latest?

  2. ABC Values and ABC Dates both are Different Drop down’s?

Regards,
NaNi

1.Before ABCDATES the last no provided is 11020,the last no is taken as the latest no.
2.Yes both are different dropdowns.

So, Last data is your latest value am i correct?

If yes, Try like This

  1. Get Full Text- Output As strValues

  2. Use Regular Expressions to get the last value

Assign RegEx = System.Text.RegularExpressions.Regex.Match(strValues,".+\z").ToString

Where RegEx is a String type:

Reference:

  1. Now take the Select item Indicate it on the First dropdown i.e., ABCValue. Open it in the UiExplorer Choose the aaname=‘{{RegEx}}’

You will get the latest value from drop down

Regards,
NaNi

But i’m not able to indicate ABCValues only, its taking ABCDATES also.While im trying to indicate the ABCValues seems to have error “This control doesnot support select item”.

Hi!

Could you please send the ABC Values Snip. Whether it is a drop down or not.

Regards,
NaNi

Sorry I cant share that thats why…

I cant share it…Sorry.
In select Items i can see values as
ABCValues:
ABCValues:/12345
ABCValues:/67891
ABCValues:/23452
ABCValues:/12010
ABCValues:/11020
ABCDATES:
ABCDATES/20/06/2022
ABCDATES/21/06/2022
ABCDATES/22/05/2022
how can i pass it in to for each and check whether it contains ABCvalues

Just pass the variable here as i mentioned above!

Regards,
NaNi

I tried that one ,but it is fetching datas from ABCDATES also.

Hi!

Have you tried the regex?

provide some more details!

  1. From where you’re getting these numbers i.e.,

[quote=“Chippy_Kolot, post:1, topic:449682”]
12345
67891
23452
12010
11020
[/quote]…

Otherthan Drop Down?

Regards,
NaNi

For reference only i posted this no.

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