How both dates matching or not

Hii Guys I need Your help…
I have excel file which in columns are " Start Date and End Date " and in web application aslo has " Start Date and End Date , then tell me how to compare excel dates with web application dates …
If both dates match “click” on button which is behind the date columns

@Sanket_RPA

It will be very difficult to say without seeing any sample screenshots?
Every usecase will have a different approaches

One of the apporach I can mention is as below

  1. Use Get text activity to extract the Start date
  2. then you use Read Range activity to read the excel file and store in a datatable variable
  3. Now you can use a foreach loop and use If condition and write as CurrentRow(“ColumnName”).Tostring = GetText variable
  4. Make sure that the excel value and Get Text value is same
  5. So in If condition if that matches you can place Click activity

Hope this may help you

Thanks,
Srini

Thanks Sri

I want to compare both start date and completion date…with web application start date and completion date

@Sanket_RPA

It’s same, first Get Text to get the Start date and second GetText to get the End date from Website after that you can compare

Hope this may help you

Thanks,
Srini

Got it Thank you so much Srinivas​:blush::blush::blush::blush:

If First number dates match then I have to click on First number button, and if 4th number date match then I have to click on 4th number button then …how Can I do that…

Hello @Sanket_RPA

For this case you can use “Switch” activity
after you get text and use if condition to set status of which one is matched
then you put into expression and set each case as you design variable name

image

Best Regard,

Thank you so much :+1::pray:

What if When I have 100 number of dates in my columns then …

Hi @Sanket_RPA

To compare the dates from an Excel file with the dates from a web application in UiPath and click on a button based on the comparison, you can use the following steps:

  1. Read the Excel file using the UiPath “Read Range” activity to retrieve the data into a DataTable variable.
  2. Iterate through the rows of the DataTable using a “For Each Row” activity.
  3. Inside the loop, extract the “Start Date” and “End Date” values from the Excel row using the row item index or column name. You can use row.Item(“Start Date”) and row.Item(“End Date”) to retrieve the values.
  4. Use UiPath activities to navigate to the web application and retrieve the corresponding “Start Date” and “End Date” values from the web application. You can use activities like “Open Browser”, “Get Text”, and “Extract Structured Data” to achieve this.
  5. Convert the Excel date values and web application date values to DateTime objects using the “DateTime.ParseExact” method or other date conversion methods, and store them in DateTime variables.
  6. Compare the dates using standard DateTime comparison methods, such as “DateTime.Compare”, to check if they match.
  7. If the dates match, you can use UiPath activities like “Click” or “Click Image” to click on the button that is located behind the date columns in the web application

I hope it helps.

1 Like

Hi @Sanket_RPA

  • You can use single click activity with dynamic selector. The moment you indicate on the button using click activity, it generates a selector, make sure the selector has aaname (which is name of the button)
  • Pass the variable into aaname within the selector. This variable (say var1)should has the number date
  • Let’s say, if the first number date matched, pass the first number date into the variable (var1), so that it clicks on the respective button

Check below link for more details on dynamic selectors

Studio - Dynamic Selectors (uipath.com)

1 Like

You need to capture data with get text activity or if dates in table format in web application use data scraping and then capture values compare values with Excel data by converting to datatime format

@Sanket_RPA

If you are able to resolve your issue
Please close this thread by clicking Mark as Solution to appropriate Post

Thanks,
Srini

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