Need to give list of files as Transaction data

I have a folder which contains list of Excel files. I am trying to retrieve them as transaction data , so that for each file I will read and fetch required data in Process and move the file and picks next transaction item(next excel file) and repeats for all the files. can anyone please explain how could this be achieved

Thanks.

1 Like

yah sure
hope these steps would help you resolve this
–use a assign activity like this
arr_files = Directory.GetFiles(“yourfolderpath”,"*.xlsx")
where arr_files is a variable of type array of sstriing
–now use a FOR EACH activity where pass the above variable as input and change the type argument as string in the property panel of for each activity
–inside the loop use a EXCEL APPLICATION SCOPE and pass the file path as item.ToString andd inside the scope use READ RANGE activity and mention the range and sheetname and get the output with a variable of type datatbale named dt
–now we can use FOR EACH ROW activity and pass dt as input and inside the loop use Add queue items activity and mention the queue name we have in orchestrator

–then next to this FOR EACH loop use another FOR EACH activity where pass the same variable arr_files as input with type argument as string
–inside the loop use MOVE FILE activity where path is item.ToString and destination as folder path wehere we want to move

Cheers @ashok.p

@Palaniyappan
Assign activity I have given it in Init and got the array of files. Do in Need to use for each there itself?
I am not using the queueItems, can you please tell me how can this be passed to get transaction data and then to Process .
Also I need to move the file only if transaction is success.

Hi

yah only then we can iterate through each file and then get the data from transactions
and for this

if we are not using queues then we can neglect the step inside the FOR EACH ROW loop with ADD QUEUE ITEMS activity
or even instead of using FOR EACH ROW loop we can use IF condition and mention like this, for more details we can see in normal REFramework Template

and finally for this we can set a boolean variable with value as true once all the transaction is done along the process
and atlast use IF condition where mention as boolvaraible=True if true it will go to THEN part where use FOR EACH loop and use MOVE FILE activity

Cheers @ashok.p

1 Like

Hi,
In Init I have given as below

and in get transaction data as


but when I run the bot, the flow is not going into Process.

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