Create Yearly Report WorkFlow- Save as File with wrong name

I am working on Create Yearly Report workflow.
I am having problems with saving the file using Type Into Activity and Click Save.

I used Assign ReportFilePath = path.Combine(Environment.CurrentDirectory,in_ReportsDownloadPath,“Report-”+in_TaxID+“-”+in_Year+“-”+item.ToString+“.csv”)

I used write Line to check and the path seems to be coming correct.
But the file is not saving with ReportFilePath name but with the generic Name called Report-RO123456-1.

I am not sure what I am doing wrong.

Hi @prasad10,

Can you use like below in assign statement, use enter hot key at the end of the expression

While downloading it gives an xlsx file, you dont have to append csv

“D:\Yearly Report\ProjectName\Downloads"+“Report-”+inStrTaxId+”-“+year+”-"+month+ “[k(enter)]”

1 Like

I tried to save the file manually with the Path.This is the error I am getting.
image

Is the format wrong?

Remove Csv file extension

HI @prasad10

In your type into activity, are you using the Simulate Type enabled? Try the solution given by @anil5 without the simulate type…

I have experienced this few times. In my cases, the issue seems to be the file is getting downloaded to a different folder that what we specify. So once we try to read it, it throws an error…

1 Like

The SimulateClick is on. I will uncheck it and try.

That worked. But a new error popped up.
image

Destination: dt_YearlyReport
Source: dt_MonthlyReport

Are you providing source and Destination Datatables in Merge Data Table activity.

Does both datatable have values?

For each activity, The first iteration will have blank dt_YearlyReport. The dt_MonthlyReport will append to the dt_YearlyReport.

This is the workflow.System1_CreateYearlyReport.xaml (26.7 KB)

HI @prasad10

Your Read CSV activity does not have a specified output datatable. That is why you are getting the error in merge data table activity

Use Build datatable activity and build a datatable with the columns in the CSV file and then append the downloaded report with the build datatable output.

1 Like

@Lahiru.Fernando, I added the output variable.

1 Like

Does it work now after the changes we both found?

It worked. It moved forward.
image

On the On Element Appear activity there, there is a property named Repeat forever which is set to True in your screenshot. Change it value from True to False. Then it should work

It worked. The workflow iterated until June. And threw this error.
image

Changed the WaitforReady Property to Complete. It moved forward. Looks like it was moving before the pop-up window for ReportNotFound showed up.

@Lahiru.Fernando
There is NO Monthly report found for July. Instead of Clicking on the pop-up message window to close it, It is looking for the drop down window for download file. Therefore, I am getting an error.

image

How to correct this?

Hi again…

Yes… you can handle this… So usually this message box appear when you click on the download button right?

So, after the click activity of the download button, you can actually include an Element Exists activity. For this activity, indicate the message box or the text that is shown in the message box. The output of this activity is a boolean value. Set the output property of this activity to a boolean variable.
Next, add a IF activity to check whether the element exists activity returned a true or false. So, if it returns true, that means the message box popped up and there is no report. If it returns false, that means there is a report to download. So all your current report download activities can be moved to the ELSE segment of the IF condition. For the THEN segment of the if condition, you can add another click activity to click on the OK button of the message box to close it :slight_smile:

Get the idea?

@Lahiru.Fernando
Yes. That is perfect. I used the same. This is the issue. The Element Exists is not waiting long enough to see if the Message window pops up. So it is assuming the Element exists is False and is moving to the ELSE segment.

I added a Delay in front of the Element exists. It is working fine now. The only issue is how much delay should I set it at.

Or is there any other way I can have it wait until the window pops up.

1 Like