Requesting assistance in utilising wildcard in selectors

Hi everyone, I am trying to implement wildcard and dynamic selector in my bot for clicking on certain buttons. Here is 3 examples of the selectors for the buttons.

html app=‘chrome.exe’ title=‘xxx’ />
<webctrl id=‘1349815_1_5/1/2022 12:00:00 AM_0’ tag=‘A’ class=‘slotBooking’ tableRow=‘1’ idx=‘1’ /

html app=‘chrome.exe’ title=‘xxx’ /
webctrl id=‘1349819_5_5/1/2022 12:00:00 AM_0’ tag=‘A’ class=‘slotBooking’ tableCol=‘5’ idx=‘1’ /

html app=‘chrome.exe’ title=‘xxx’ />
<webctrl id=‘1348260_2_4/1/2022 12:00:00 AM_0’ tag=‘A’ class=‘slotBooking’ tableCol=‘2’ idx=‘1’ /

I am planning to implement dynamic selector for the tableCol selector and for the id selector. This is what I have tried but it fails to work.

webctrl id=’__{{date_name}} 12:00:00 AM_0’ tag=‘A’ class=‘slotBooking’ tableCol=’{{session_number}}’/

May I kindly ask what am i doing wrong?

Hi,

Your selector is as the following, isn’t it?

<webctrl id='*_{{date_name}} 12:00:00 AM_0' tag='A' class='slotBooking' tableCol='{{session_number}}'/>

For now, can you check content of date_name and session?
Next, set default value of date_name and session_number in variable panel. Then we can validate the selector as if default value are set the value to the variable.

Regards,

Ok i think i realise the problem. I set as 5/1/2022
in excel which autoconverts it to date, and when it is read by uipath it changes to 05/01/2022 . How do i prevent this from happening? Thanks for the response Yoichi!

Hi,

Can you try to use the following expression just before the activity?

date_name =   DateTime.Parse(date_name).ToString("M/d/yyyy")

Regards,

Thank you sir, works fine. Bless you!

1 Like

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