Move File - issues with expando fields in file path (10 replies and 3 comments)
Arline, remove the value from Source Directory and simply enter into the Source File either:
\\networkshare\GroupDocs\Accounting Share\Customer Invoices\%[CUSTOMER]\%[YEAR]\*.pdf
OR
%SourceDirectory\*.pdf
Weird, something must be wrong for me still. I tried both those with these results:
Testing with:
\\networkshare\GroupDocs\Accounting Share\Customer Invoices\%[CUSTOMER]\%[YEAR]\IN00003.pdf (I was just testing with a single invoice to see if I could move it)
That gave me this response:
Ill-formed field at position [54] of string - \\echofs\GroupDocs\Accounting Share\Customer Invoices\%[CUSTOMER]\%[YEAR]\IN567643.pdf . The field must in the form ..
So position 54 is right when we have the field: %[CUSTOMER]
Then I tried the next approach and limited it again to a single PDF:
%SourceDirectory\IN00003.pdf
The response was:
The path is not of a legal form.
So since it's still working when I hard code the path, what do you think I must be doing wrong?
Scratch that, I reviewed Errors.txt - looks like if I use the full RecordID.FIELD naming convention, it's happier!
I'm getting new errors on the destination directory.
Again, it works fine when I hard code the path. It's having trouble building the file path and I can't understand why.
I cleared the values for "Destination Directory"
I added a couple variations for "Destination File"
I've tried these both for destination file:
\\networkshare\groupdocs\Sage300\ECHOAP\Customers\%[Record.CUSTOMER]\Invoices\%[Record.YEAR]\HC\%FILENAME%FILEEXT
\\networkshare\groupdocs\Sage300\ECHOAP\Customers\%[CUSTOMER]\Invoices\%[YEAR]\HC\%FILENAME%FILEEXT
Here's what I see in errors.txt for both:
2020-07-06 09:47:40:706 - System.IO.DirectoryNotFoundException: Could not find a part of the path '\\networkshare\groupdocs\Sage300\ECHOAP\Customers\%[Record.CUSTOMER]\Invoices\%[Record.YEAR]\HC\IN567643.pdf '.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite)
at Realisable.Data.Transform.TransformTaskFile.ProcessFiles(Boolean copyFiles)
at Realisable.Data.Transform.TransformTaskFile.Process()
at Realisable.Data.Transform.TransformControllerInterop.Process()
2020-07-06 09:49:28:047 - System.IO.DirectoryNotFoundException: Could not find a part of the path '\\networkshare\groupdocs\Sage300\ECHOAP\Customers\%[CUSTOMER]\Invoices\%[YEAR]\HC\IN567643.pdf '.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite)
at Realisable.Data.Transform.TransformTaskFile.ProcessFiles(Boolean copyFiles)
at Realisable.Data.Transform.TransformTaskFile.Process()
at Realisable.Data.Transform.TransformControllerInterop.Process()
Any suggestions on handling the destination directory differently?
Can you please provide a screenshot the File Task?
Here it is- thank you.
Arline, we have reviewed and you cannot do want you want to.
The destination folder or file do not support Expando fields; only the Source File does.
You can only use the %FILENAME & %FILEEXT in the destination file.
The reason is due to the way we process file requests.
Oh deary me. What are my options, in that case? Wondering if I could use a function- you showed me how to use a file task to create network file folders at one point. Could I use a modified function to accomplish this?
Hi Arlene, I know this is ancient, but have you got move file working reliably using expando fields for both source and destination? If so are you prepared to share your solution?
This feature has been added to v4.2 PU4.
Hi Arlene, I know this is ancient, but have you got move file working reliably using expando fields for both source and destination? If so are you prepared to share your solution?
Mary, try upgrading your Iman instance as a first step, since Iman support says that this feature is part of v4.2PU4.
Or you could always try putting the whole dynamic path in a single field, which is what we've been standardizing on. Use a map transform, create a new field called "FilePath" for example, and use the map transform to build the full file path in that field. Then in your file task you can just add the new field %FilePath as the directory.
Good luck
Hi there,
Looking for some guidance on the Move File task. I'm trying to use expando fields in my source & destination directories but can't quite get it working. I can successfully move a file when I hard code the source & destination directories.
I've gone down 2 routes when trying to use the expando fields in the directories. Here's an example with source directory:
Attached is what I'm working with. The field %SourceDirectory looks right to me in the map transform.
Any ideas on how I could better get this working?