September 1, 2022, 12:21pm
can anyone help
Pick the first entry from LOG file where ‘Completed’ column-C value is not ‘X’ and obtain the PAYROLL DATE (Column-A ) and Invoice Date (Column-B)
then check in folder for excel file
Note: excel file will be saved as “Mastercostjob1-27-22” and “salesjournal1-27-22”
September 1, 2022, 12:52pm
Do you ONLY need the first row with no X and after that the table is disregarded?
September 1, 2022, 1:05pm
No i have to read one bye one
Hey! Welcome to community!
Read range - Output - DtOut
For each row in data table pass the - DtOut
Now take one if condition pass the condition like this
CurrentRow("Completed").ToString.Trim = ("X")
In Else block
Take one assign activity create one string variable called PayrollDate pass the value like this
Assign PayrollDate = CurrentRow("Payroll Date").ToString.Trim
Take one more assign activity and create one more string variable called Invoice date pass the value like this
Assign InvoiceDate = CurrentRow("Invoice dDate").ToString.Trim
Now take one more assign activity and create one more string variable called FolderPath pass the value like this
Assign FolderPath = "Desktop\InputFolderPath\"
Now create array of string variable called Files and pass the value like this
Assign Files = Directory.GetFiles(FolderPath,"*.xlsx")
Take for each pass the Files
Now take one more Assign activity and create one more string variable called FileName pass the value like this
Assign FileName = Path.GetFileNameWithoutExtension(item)
Now take one more if condition pass the condition like this
In the then block you will get the matched records
Try this and let me know
September 1, 2022, 1:12pm
Can you please connect with me if possible
September 1, 2022, 1:20pm
Your solution is both elegant and great, but I foresee one small issue if all the original data is as posted:
The formatting of the dates are not equal between the table and the file names, so the strings won’t match.
you need to include a strVariable.replace(“/”,“-”) to have successful matches.
Assign PayrollDate = (CurrentRow(“Payroll Date”).ToString.Trim).replace(“/”,“-”)
September 1, 2022, 1:21pm
Can you please connect with me if possible getting error
September 1, 2022, 1:22pm
Can you post your error and some screen shots? (or better; attach your xaml file)
September 1, 2022, 1:26pm
Check your Variables configuration:
is it set to Array of String?
September 1, 2022, 1:28pm
its array of string
not able to upload xaml file since i’m new user
can you share ur Gmail so that i can share it
September 1, 2022, 1:31pm
Nevermind my previous note, the variable “Folder” should be just a string" it’s a single entry. That should not be set to Array of String.
And unfortunately, I do not post my email (or contact information) in public forums. Sorry. But happy to help here.
September 1, 2022, 1:32pm
ok no issue i’ll keep post here only
I’ll recommend you to go through the above mentioned solution…
You can achieve this…
I mentioned variable type and also the variable name
Kindly check the each point .
If you stuck anywhere please let me know
September 1, 2022, 1:34pm
sure i’ll try and update you
September 1, 2022, 1:35pm
DO i need to update anything in Then block
September 1, 2022, 1:37pm
It is harmless to leave it empty. Depending on the volume, you can decide to do a Log Message to confirm the Row is not applicable (recommend a Trace-level).
September 1, 2022, 1:38pm
okay once its done will update you
September 4, 2022, 1:39pm
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.