Selecting date from calender with dynamic variables

Hello.

I am trying to select the date from the below calendar in Microsoft Teams.


The text box is not editable and the date comes from another source so can be dynamic.

The selectors are the following:
image

And it is not possible to use the ui explorer as it does not find the element.

I’ve created a dynamic variable to put on the aaname value so it picks the right value, and this works.
But…the problem is when there are two “30” values for example (one for the previous and one for the current month), in this case it selects the value for the previous month which is wrong.
I tried to add an idx=“2” selector and this works, but then I get problems with the rest of the values for which idx=“2” is not valid.

Does anyone have tips on this? I tried looking into al similar topics, but no one answers to this duplicate date value problem :slight_smile:
Thank you very much in advance.

@ydb94 Yes I think you would have to provide the tableRow attribute for that as well, to uniquely identify the 30 for the next month.

@supermanPunch thank you for your response! Yes, but the table row in this case would be 7, but sometimes, when on the last row, the table row is 8, also this is varying and I am struggling to find a way how to handle it.

@ydb94 Yes you might need to make use of regex for that to select only tableRow which doesn’t fall in the range [1,2] . We might not be able to get the last table row or the table Row of the last 30 but we can exclude the starting two rows 1 and 2 as the previous month’s 30 can only appear in those two rows.

Do you maybe have an example? Thank you

@ydb94 Check this :

2 Likes

Yes, it works for the high values (30, 31 etc)!! But now the bot gets the lower values wrong (01, 02, etc) and takes the values for the next month :frowning:

@ydb94 I think in this case you’ll be needing to use an if Activity with condition being based on the date value and if the date is greater than 20 you can use a Click Activity with this Selector and if it’s less than that you can use Click activity with normal Selector.

Check if this works. Right now I can think of only that condition :sweat_smile: I’m not sure if there is any other differing factor for the two same numbers.

It worked @supermanPunch! Thank you sooo much for your support!

1 Like

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