Forum Discussion

AdrianH's avatar
AdrianH
New Contributor II
9 years ago

Dynamic Values & the File Poller

Anyone managed to get this to work using dynamic values i.e.

‘MyFileName’ +data.now()+‘.txt’

plus does anyone know how to cause this to fail if the file never turns up?

Currently it seems to finish with success no matter what.

5 Replies

  • del's avatar
    del
    Contributor III

    Yes, we use the File Poller using dynamic file names in a couple of pipelines and it works well for us.

    It may just be a typo in your question, but you need to make sure you use the correct case-sensitive syntax to generate the dynamic file name (See https://doc.snaplogic.com/wiki/display/SD/Date+Functions+and+Properties for Date to-string functions).

    As for the success/fail question; the File Poller is designed to poll a file path until a matching file exists, so it will almost always succeed unless the file path becomes unavailable (someone please correct me if I’m wrong). So, depending on your business requirements, if you need to fail, throw an exception, or send notification on a late or missing file delivery, it may be better to use a File Reader on a Task Schedule rather than a File Poller

  • AdrianH's avatar
    AdrianH
    New Contributor II

    Hi,

    Thanks, case-sensitivity is the big leveller.

    Just one additional question if I may, how do you throw an exception from within a pipeline?

    • nganapathiraju's avatar
      nganapathiraju
      Former Employee

      almost most of the snaps have error views enabled.

      In the views, under error, choose what to do instead of stopping the
      pipeline. When you enable another view will be visible

      Thanks & Regards,
      Naveen

  • AdrianH's avatar
    AdrianH
    New Contributor II

    Done that, the problem is it always completes with a success.