Automate Daily File Import

2 posts / 0 new
Last post
Breanna_28
Offline
Joined: 10/24/2016 - 15:02
Automate Daily File Import

Hi there,
I am working in the IDEA server version and am trying to write a script that will automatically import a file that is sent to our server daily.  The file name has the prior day's date at the end.  I have tried using a function that works when I evaluate it within the 'Criteria' window, but within my script I keep getting an error.  My line of script with the error looks like this:

  • task.UploadToLibrary Current + "PD_SmartStreamToIDEA"&(CurlVal(Dtoc(Date(), "YYYYMMDD"),",",".")-1)& ".csv", "Source Files", true

The error I am receiving says the following:

  • Sub or function not defined: Dtoc

I currently have a prompted script that works fine, but am looking to create an automated one.
Does anyone know how to resolve this error or a different function that would work better?
Thank you!
Breanna

Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

Hi Breanna, it is because the DtoC is a function in the equation editor and not visual basic.  Instead try:

format(now, "YYYYMMDD")