Sam_H
(Sam H)
September 1, 2022, 12:21pm
1
Hi all
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”
1 Like
devroen
(Devroen)
September 1, 2022, 12:52pm
2
Hey Sam,
Do you ONLY need the first row with no X and after that the table is disregarded?
Sam_H
(Sam H)
September 1, 2022, 1:05pm
3
No i have to read one bye one
Hey! Welcome to community!
Try this:
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
FileName.Contains(PayrollDate+InvoiceDate)
In the then block you will get the matched records
Try this and let me know
Regards,
NaNi
1 Like
Sam_H
(Sam H)
September 1, 2022, 1:12pm
5
Can you please connect with me if possible
devroen
(Devroen)
September 1, 2022, 1:20pm
6
Nani,
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(“/”,“-”)
2 Likes
Sam_H
(Sam H)
September 1, 2022, 1:21pm
7
Can you please connect with me if possible getting error
devroen
(Devroen)
September 1, 2022, 1:22pm
8
Can you post your error and some screen shots? (or better; attach your xaml file)
devroen
(Devroen)
September 1, 2022, 1:26pm
11
Check your Variables configuration:
is it set to Array of String?
Sam_H
(Sam H)
September 1, 2022, 1:28pm
12
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
devroen
(Devroen)
September 1, 2022, 1:31pm
13
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.
Sam_H
(Sam H)
September 1, 2022, 1:32pm
14
ok no issue i’ll keep post here only
Hey!
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
Regards,
NaNi
Sam_H
(Sam H)
September 1, 2022, 1:34pm
16
sure i’ll try and update you
1 Like
Sam_H
(Sam H)
September 1, 2022, 1:35pm
17
DO i need to update anything in Then block
devroen
(Devroen)
September 1, 2022, 1:37pm
18
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).
Sam_H
(Sam H)
September 1, 2022, 1:38pm
19
okay once its done will update you
system
(system)
Closed
September 4, 2022, 1:39pm
20
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.