I am trying to build the workflow for invoice extraction using -Document understanding.
The issue is
I am creating an excel file - Which extracts all the information from the invoice.
The excel file is in the format - Sai_export - 20220714-093133 (with date time in the end)
This is in the beginning of the workflow. The syntax is
Path.Combine("\UiPath\Invoice_Recon\Email\Processing\File_Extract_Temp",String.Concat(“Sai_export - “,DateTime.Now.ToString(“yyyyMMdd-HHmmss”),”.xlsx”))
In the later part of the workflow i need to use the same file. But when i am referencing the same file with Path.Combine("\UiPath\Invoice_Recon\Email\Processing\File_Extract_Temp",String.Concat(“Sai_export - “,DateTime.Now.ToString(“yyyyMMdd-HHmmss”),”.xlsx”))
Error - The path
Can you please let me know how can i reference the same file in the workflow?
I believe the problem is that you’re still using the DateTime.Now.ToString(“yyyyMMdd-HHmmss”) - The time to the second has been written into the Filepath and can’t be referenced using the same syntax later on as the time will be different.
Consider writing the Path to a String variable before using it and passing this variable around to ensure you can constantly referenced it.
Variable of type string FilePath = Path.Combine("\UiPath\Invoice_Recon\Email\Processing\File_Extract_Temp",String.Concat(“Sai_export - “,DateTime.Now.ToString(“yyyyMMdd-HHmmss”),”.xlsx”))
In the later part of the workflow pass this variable
OuputFilePath (should be Before equals to) = Path.Combine("\UiPath\Invoice_Recon\Email\Processing\File_Extract_Temp",String.Concat(“Sai_export - “,DateTime.Now.ToString(“yyyyMMdd-HHmmss”),”.xlsx”))
Thank you @ushu . So this is the later part of the workflow where ia m referencing the same file. so instead of Path.combine is should give OutputFilePath?
Please let me know thanks
The first part is for store the entire path in a variable. So that this variable have your file path and that can be used when you want to access that file instead of giving the entire path
Try this, click on the first assign activity, navigate to the variables panel, and search for OutputFilePath variable. Click on the scope and change the scope to your workflow name