Uipath automation - automation

I want to take the report of last one download details from the mysql database and sent to my project manager on every monday through the email so the process remains same only date would be change dynamically so, I would like to automate this process using RPA UIpath.
Anyone could you help me to achieve this process.
Thanks

Use 'Database' package to connect to sql db and and run the query.
Schedule the program to run every Monday using Orchestrator.
Create the report with current date using DateTime function

There will be some extra steps like transforming data as necessary etc, but the basic outline of this process is as follows
Download MySQL ODBC Drivers MySQL site
Control Panel -> Setup ODBC Data Sources (32-bit) setup User or System DSN, make sure to test your connection to see if it works OK (it's similar to how you set it up in MySQL Workbench or read about it here)
In your UiPath Studio Package Manager, add Database Activities Pack.
Get your data using UiPath.Database.Activities.ExecuteQuery activity to a DataTable
Write your data to an Excel file using Write Range activity
Send your mail through SMTP using UiPath.Mail.SMTP.Activities.SendMail including freshly created Excel file as attachment

First step Take the data using database activity
Create an automation in UiPath to attach and send to your respective email
Schedule it own orchestrator.
Though not exactly but atleast sending a mail by taking credential from Orchestrator is shown in this article
https://www.c-sharpcorner.com/article/create-a-sequence-project-for-sending-a-mail-using-smtp-activity-by-taking-crede/

Related

How do I set up an automated CSV export job from Azure SQL Server?

In an on-prem SQL Server I have the option to set up scheduled Jobs with the SQL Server Agent. This feature is not present in Azure. Is there any way to do this easily in Azure or will I have to rely on automation scripts / powershell scripting for this?
The task I want to accomplish is to export a bunch of SQL views to CSV and send them to a remote FTP server.
In Azure, through Logic Apps, you can achieve this. Please check below steps.
Go to Azure Portal ( http://portal.azure.com/ ) and Search Logic Apps.
Click Add and fill the details like Logic App Name, Subscription,Resource group, Location and click Create.
After refreshing the page, click the Created Logic App. In the home page, choose Blank Logic App.
In the Logic Apps designer Page, Search for Schedule or Recurrence and click it.
Fill the Interval, Frequency, Time zone (Format is important – 2018-10-16T21:00:00Z ), Start time, at these hours, at these minutes, Check the Preview.
Choose an Action, Search for SQL Server and Click Execute Stored Procedure in the list.
Click Add New connection at the end if you want to create new connection. Then Click Manually Enter Connection Information at the end if you want to create new connection.
Or else use anyone of the Existing connections. Fill the Procedure name with the required SP & below are the input parameters of the SP that you selected.
Choose an Action, Search for Create CSV Table and Click it. Fill the From (choose dynamic result set from the right side-Choose first result set alone), Include Headers (Yes), Columns (Automatic).
Choose an Action, Search for Office 365 Outlook & Search for Send an Email and Click it. Before proceeding, Please check mail id at the bottom. Change as yours. Fill the To (zzzzzz#xxxxxx.com;zzzzz#xxxxx.com), Subject (Demo mail), Body (Please check the test attachment), From & CC & BCC (email id’s for whom you want to send), Important (Normal), Is HTML (NO), Attachment Name {choose expression from the right hand side and type concat('Test_mail',utcnow('dd-MM-yyyy'),'.csv') }, Attachment Content (Choose output from the right hand side).
Finally Click Save at the left hand side top. Click Designer option to edit, after edit completes, again save that. Click Run for Demo Run.
Click Run to initiate the trigger. Then only the automated mails should come at mentioned intervals.
Select the Required Logic App and click Delete to delete it (will ask Logic App name to delete).
You should have access to do the above changes and you have to sign in to open the azure portal.
One option is to use Azure Data Factory and create a copy activity that use Azure SQL Database as a source and SFTP as a sink. Use copy activity to copy data from any supported data store to your SFTP server located on-premises or in the cloud. You can schedule execution on Azure Data Factory as shown here.
Another option is using Azure Logic Apps with the Azure SQL Database connector and FTP connector to access/manage SQL Database and FTP server. You can create, schedule, and run recurring tasks with Azure Logic Apps as shown here.

Database automation using uiPath

I am working on uiPath for one application. In that I want to fetch the data from the database and write it to a CSV file. I saw one workflow sample here I tried using that. But I got stuck. I am not able to connect to database. I have database installed on the same machine.
How can I set up configuration wizard db connection?
It is possible to get to shared mailbox in exchange using uipath to call a powershell script!!! I was stuck on that one for a while, but eventually got it working:):) no need to use outlook...
You need a database connection string that works. If you know it just add it in the connection string property. Otherwise try to use the UiPath wizard to generate it.
In Exchange it's not possible to get the messages from a shared mailbox with UiPath Exchange activities but it's possible with Outlook activities.

Updating System variables in SSIS package

Similar to this post
I have an SSIS Package with a Script Task that creates an Excel file on disk and populates it with data from a SQL Stored Procedure (using Microsoft.Office.Interop.Excel). This works great when testing and when running the deployed package manually through the SSIS Catalog, but when I schedule the task to run automatically through SQL Server Agent, the Package fails in the Script Task step. I have the Job running as a Proxy account that is the same as the account I'm logged into the server with when testing (and the same as the account that works when manually running the packages).
My understanding is that even though the job is running using a Proxy, any desktop interaction occurs within the Profile context of the SQL Server Agent login. Since that profile isn't actively logged in, the interaction fails. Digging in more, there is a bool System Variable in the package called "InteractiveMode" that is set to "False". I have a feeling that if I could switch that to True, everything would be hunky dorey. Trouble is, that variable is only accessible to my Script Task as "ReadOnly"...
Is there any way to set the System:InteractiveMode Variable in an SSIS package manually or programatically at runtime? Please help! I'm having to run these scheduled jobs manually for now, which is a big pain.
Thanks.
I had this problem a few months ago and it turned out that the execution options needed to be set to use 32 bit runtime. If you're using SQL Server 2008 R2, you can open your job and double click on the step. It's under the Execution Options tab.
If you continue to have errors, you may want to consider changing the package so that it uses a file system task to create/rename the excel document and then a Data Flow Task to move the data from your stored procedure to your excel document. Depending on your data, you may need to add a Data Conversion step in between. Here's a good article on the topic: http://www.mssqltips.com/sqlservertip/3046/sql-server-integration-services-data-type-conversion-testing/
Edit:
I haven't used SQL Server 2012 yet, but according to MSDN, it looks like the option is under the Configuration tab. Here's their article: http://msdn.microsoft.com/en-us/library/gg471507(v=sql.110).aspx

Automate report download from SAP Business Object Infoview

I am new to SAP Business Objects Infoview and was asked if I can automate the report data generation for an existing report.
Here is what I would do manually through the Infoview web interface:
Click schedule for the report in question, which brings up the Schedule dialog
Change the recurrence to Now
Change the report prompts (start date and end date) so that start date=today and end date=today-14 days
Set the format to CSV and output the report to the Inbox
Schedule the report
Wait for the report to succeed
Download the generated report data
I can see how I could build a tool using Java and Selenium to automate this. However I am wondering if there is a more elegant way to doing this that still allows me to set the prompts dynamically. Are there existing 3rd party tools? Can I use JDBC?
What I have at my disposal is a user name/password to log on to Infoview. If a more elegant solution requires additional access or software please let me know.
It's possible with a simple addition to the universe (but this, of course, requires universe developer access). For your example, you could create a new universe-based Predefined Condition object with a definition of: (assuming Oracle)
start_date = trunc(sysdate) and end_date = trunc(sysdate-14)
Adding this object to a report will produce the desired timeframe whenever it's run, whether it's scheduled or interactive.
If you want the same report to run with this logic when scheduled, but still allow users to select dates via the prompts. You can use magic dates. See this blog post for info.
Lastly, you could write a custom program that would open the report, populate the prompts with the appropriate values, and run it. But I would consider that a less-preferable option than the ones above.
You can use UiPath in order to easily automate SAP GUI without writing code.
Here's a tutorial on how to automate data entry, menu navigation and screen scraping on SAP.
You can use it from code (SDK) or you can create workflows (visual automation) directly from UiPath Studio.
Note: I work at UiPath. You should also try other visual automation tools like Automation Anywhere, WinAutomation, Jacada, use them side by side and choose the one that suits better your needs.
Here's how automating SAP Business One menus, buttons and typing looks like:

Writing data back to SQL from Excel sheet

I know it is possible to get data from a SQL database into an excel sheet, but i'm looking for a way to make it possible to edit the data in excel, and after editing, writing it back to the SQL database.
It appears this is not a function in excel, and google didn't come up with much usefull.
If you want to have the Excel file do all of the work (retrieve from DB; manipulate; update DB) then you could look at ActiveX Data Objects (ADO). You can get an overview at:
http://msdn.microsoft.com/en-us/library/ms680928(VS.85).aspx
You want the Import/Export wizard in SQL Management Studio. Depending on which version of SQL Server you are using, open SSMS (connect to the SQL instance you desire), right click on the database you want to import into and select Tasks.. "Import Data".
In the wizard, click Next (past the intro screen) and from the Data Source drop list select "Microsoft Excel". You specify the path and file name of the Excel spreadsheet, whether you have column headings or not.. then press Next. Just follow the wizard through, it'll set up the destination (can be SQL Server or another destination) etc.
There is help available for this process in SQL Server Books Online and more (a walkthrough) from MSDN.
If you need something deployable/more robust (or less wizard driven) then you'd need to take a look at SQL Server Integration Services (for a more "Enterprise" and security conscious approach). It's probably overkill for what you want to accomplish though.
There is a new Excel plug-in named "MySQL for Excel" : http://www.mysql.com/why-mysql/windows/
I just had a need to do this, and this thread has been quiet for a long time, so I thought it might be useful to supply a recent data point.
In my application roving salespeople use a copy of an Excel workbook that tracks the progress of a prospect through a loan application. The current stage of the application needs to be automatically saved back to a remote SQL database so that we can run reporting on it.
Rejected methods for updating the database from Excel:
SSIS and OpenRowSet are both methods for allowing SQL Server to pull the data from Excel, and don't work very well when the Excel workbook is sitting in an undefined location on a user's computer, and certainly not when the workbook is currently open in Excel.
ADO is now, if not actually deprecated, nevertheless looking very long in the tooth. Also, I wanted the solution to be robust in the face of the user possibly not being connected to the internet.
I also considered running a web API on the destination server. Macros in the Excel workbook connect to the web API to transfer data. However, it can sometimes be painful to allow a web API to talk to the outside world. Also, the code to make it robust in the face of temporary loss of internet connection is painful.
The adopted solution:
The solution I plan to adopt is low-tech: email. Excel emails the data to an address hosted on an Exchange server. Everyone in the company has Outlook installed, so the emails are sent by programmatically adding them to the Outlook Outbox. Outlook nicely handles the case when the user is offline. At the server end, a custom C# executable, fired up at regular intervals by the Task Scheduler, polls the inbox and processes the emails.
You could use try these add-ins :
www.QueryCell.com (I created this one)
www.SQLDrill.com
www.Excel-DB.net
You can use the OPENROWSET function to manipulate Excel data from a T-SQL script. Example usage would be:
UPDATE OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;DATABASE=c:\MySpreadsheet.xls',
'Select * from MyTable')
SET Field1='Value1' WHERE Field2 = 'Value2'