Not able to understand which activity to be used

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”

image

1 Like

Hey Sam,

Do you ONLY need the first row with no X and after that the table is disregarded?

No i have to read one bye one

Hey! Welcome to community!

Try this:

  1. Read range - Output - DtOut
  2. For each row in data table pass the - DtOut
  3. Now take one if condition pass the condition like this
CurrentRow("Completed").ToString.Trim  = ("X")

In Else block

  1. 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

Can you please connect with me if possible

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

Can you please connect with me if possible getting error

Can you post your error and some screen shots? (or better; attach your xaml file)

ok i’ll attach file

Check your Variables configuration:
is it set to Array of String?

image

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

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.

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

sure i’ll try and update you

1 Like

DO i need to update anything in Then block

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).

okay once its done will update you

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.