Skip to main content

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 Thu, 09/12/2019 - 18:32

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

format(now, "YYYYMMDD")

The website encountered an unexpected error. Try again later.