Looking for value in excel and sending Email

Hello, i am preparing robot to do next tasks

1.robot has to check in database if entered value exists in a row. (it should check row by row I guess.). there are two options it exists or don’t.
if input matches with the info in database robot sends email with the information from that row.
if there is no match in any row than must send only one informational mail.

I don’t know what i am doing wrong but it checks only first row ))))

Main.xaml (17.5 KB)

You are checking the values outside the loop, so it will check for only one value . place the decision box and the process you want to do in the loop @meshvela. That will check for all rows

1 Like

I’ll try thanks

even for the one value it is only giving false email even when they match

May be the value you are getting in the datatable is not same as the one you entered, please try a message box before the check decision @meshvela , one more thing is, instead of decision box, use if condition so that it will be easy to understand

I used If condition but in this case It was sending one email for each row when it was not matching for example if there are 30 rows and it matches with one row it should send 1 email that there is a match and if there is not a match it should send 1 informationa email that there is no match. but instead it is sending 29 mails that there is no match and one that it is matching

Hi
Welcome back to uipath community
Hope these steps would help you resolve
—use a database activity like EXECUTE QUERY and get the output as a datatable variable named dt
—if the inputs is in a variable like under name str_input the use a for each row loop and pass the above datatable variable as input
—Inside the loop use a if condition like this
row(“yourcolumnname”).ToString.Equals(str_input)
If true it will go to THEN part where we can send a mail with that row information or it will go to ELSE part where we can send only the information we need

Hope this would help you
Kindly try this and let know for any queries or clarification
Cheers @meshvela

1 Like

@meshvela Check attached xaml file i have made some changes.

Main (3).xaml (13.0 KB)

1 Like

@indra thanks for your response but flow decision condition is not valid. also I need to get exact row if there is a match in mail. Is there possibility to somehow extract the row for mail message?

@Palaniyappan I’ll try your way thanks.

@Palaniyappan it almost works)) right now i have two problems

  1. if it does not match with input i want to send only 1 email and it is sending for the each row one.
  2. I want to include that row also in the email.

do you have any suggestions?

1 Like

@indra It almost works the way I want. I just wounder can message box (later i’ll change by email.) somehow give the result row? now message box just gives Result (for excample A10) and i want to give content of the rowMain.xaml (19.5 KB)

1 Like

@meshvela Right now I am not having studio access to check your xaml file can you share the screenshot

It looks like this, beside input activity. maybe I should assign rows and then put them in message box?

@indra I did it it worked thank you for your help

1 Like

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