List of string assign date

Im having trouble with creating a new list of sting by date. In my automation I need to check a date and if that date matches a date in my variable then it needs to click on a link.

For testing purposes i need to check the following dates.

  1. 07/31/2020
  2. 06/30/2020
  3. 05/31/2020
    How would i make these dates in a list variable in the assign activity?

For the final automation the dates will be

  1. 07/31/2020
  2. 08/31/2020
  3. 09/30/2020
    How would i make these dates in a list variable in the assign activity?

I have attached a picture of where im at right now, some help is appreciated.

1 Like

Hello @NATHAN_MORA,

You can try this

lstStrVar = List(Of String)({“07/31/2020”, “06/30/2020”, “05/31/2020”})

Cheers
@NATHAN_MORA

Hi @NATHAN_MORA

Why dont you use Add To Collection Activity as shown below :-

image

Mark as solution and like it if this helps you :slight_smile:

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

Pratix,
Could you elaborate some on this?

Hi @NATHAN_MORA

“Add To Collection” is the activity by using you can add your values to the Collections type of variable Like List in your case.

You can refer below document and thread for the same :-

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

Patrix,
My automation needs to check if a date exists. I’m trying to create a variable with the dates i provided.I have attached a picture of the data table. If the invoice date matches a date in my variable then click on the invoice #. For this im trying to use a assign activity for my dates variables and if those date match then click on the invoice #. is this the right approach ? I have attached a picture of the selector for the element exists activity. for the date 07/31/2020 Let me know what you think.

data table

Hi @NATHAN_MORA

As per my understanding you are trying to Check whether the value(Date) is present within List or Not and depending on that you are trying to click on the InvoiceNo for that particular Present Date
Right ??

If the Answer is Yes then

Assume that you already have Date values store in List(Of String) as shown by @Pradeep_Shiv

So instead of Element Exists Activity use Get Attribute Activity as shown below for the above selector you have shown and store it in variable say “dateExists” :-
image

Then you can use If activity as below and depending on that you can click on the InvoiceNo infront of that Date as shown below :-
image

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

Thank you all this has got me on the right track.

1 Like

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