@mazlumkacar (mazlum kaçar) posted a new topic, subject "How to read and filter e-mail and insert or update a record in SQL Server?". It read:

   Hi all,
    
    I set up a for each loop.
    
    I want to robot read e-mails that contain a string word like “answer”.
    
    And then update a records in Sql Server.
    
    May i know how can i do that? i am a very new uipath user:/

To which @HareeshMR (Hareesh Madasi) replied

    Have you changed the type argument to System.Net.Mail.MailMessage in for each loop? @mazlumkacar
    
    Can you confirm whether you want to check the word answer in Subject of the mail or the body?

@mazlumkacar (mazlum kaçar) replied

    Here is my variables. And i want to check the word in the subject and also body. But i do not know how will i update the record that comes with mail in the Sql Server.
    
    image1568×728 41.5 KB

@HareeshMR (Hareesh Madasi) replied

    I mean click on the for each activity and in the properties pane, change the type of type. It seems you already changed it. That's ok.
    
    Use a if condition and give the condition as
    
    item.subject.contains(“word”) and item.body.contains(“word”)
    
    Then use the connect activity inside THEN condition and connect to sql server.
    
    You need to download uipath.database.activities @mazlumkacar

Then @system (system) said

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


{'source': 'discourse', 'url': 'https://forum.uipath.com/t/how-to-read-and-filter-e-mail-and-insert-or-update-a-record-in-sql-server/154730', 'title': 'How to read and filter e-mail and insert or update a record in SQL Server?', 'views': 570, 'has_accepted_answer': True, 'word_count': 205, 'like_count': 0, 'reply_count': 1, 'participant_count': 2, 'posts': 5, 'tags': 'studio', 'author': '@mazlumkacar (mazlum kaçar)', 'participants': '@mazlumkacar (mazlum kaçar), @HareeshMR (Hareesh Madasi), @system (system)', 'image_url': [None], 'created_at': '2019-09-27T11:25:03.046Z', 'last_posted_at': '2019-10-01T07:56:34.660Z'}