How i can get the latest year from the drop down

Hi,
I’m attaching an image… How will I be able to get the latest date from the given dropdown.
Can anyone please help me to get it.

1 Like

Hi @Chippy_Kolot

Assign-> Year = Now.ToString("yyyy")

Pass Year.ToString is Select Item activity by indicating the drop down box.

Regards

Hi,
Assign activity
Latest year = system.datetime.now.tostring(“yyyy”)

Pass the latest year in typeinto…

Thanks

Use Find Children to get all the values then sort to get the highest number to the top then take the first item.

We assume that the question is about on how to get the latest date offered as options from the dropdown, Right?

it depends on the type dropdown

Lets assume an essential HTML Select element, along with the option elements

Getting all options:

  • find children
  • get Attribute - attribute name: items

Evaluating the latest year:

  • we would convert the string to an int32 and then look for the max value

e.g.
myMyFindChildrenOut.Max(Function (x) CInt(x.Get("innertext").toString.Trim))
Or
myGetAttrReturnAsStringArray.Max(Function (x) CInt(x))

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