Results 1 to 5 of 5

Thread: Switch doesnt work as expected... Alternative?

  1. #1

    Default Switch doesnt work as expected... Alternative?

    I have 2 files

    File A is always present (csv)
    File B is sometimes present (xlsx)

    is there a way to choose with path to use depending on if File B is present?
    Essentially, File B is used to filter (Xref) File A... then that output is used.. but if not there, then Just use File A

  2. #2
    Lavastorm Employee stonysmith's Avatar
    Join Date
    Nov 2006
    Location
    Grapevine Tx
    Posts
    799

    Default

    The Excel node, by itself, will fail if you specify a hard-coded name for a file that doesn't exist.
    The way around that is to use a DirectoryList node in front of it - that way Excel will simply return zero records

    Then, create a dummy StaticData node that has the columns you require from the Excel, and use the CAT node to force those columns into the stream.

    Attached is a sample.
    Handling Missing Input.brg

  3. #3

    Default

    that part is all fine.. i am using it. the problem is after it.


    CSV file > Filter > Filter > Sort \/>--------------->Switch> output
    | |
    | |
    |---- XREF ---------
    XLS file > -------------Sort--------



    i couldn get an image to work.. lol

    CSV to the switch always wins so it just goes thru..
    I need it to take the XREF path with the XLS file has data/exists

    Can something go in between the CSV sort and switch that will disable if the XLS file loads?

  4. #4

    Default

    Capture.JPG

    wait got it... in the picture case it should only use the APFEED file..

    here it should use the XRef path
    Capture2.JPG
    Last edited by StaticFX; 05-14-2019 at 02:20 PM.

  5. #5

    Default

    Only way it works so far is to use a sleep timer, which is not going to be reliable.
    i mean, i suppose I could use a metacheck.. but then to have to entirely different streams would be crazy. a LOT happens outside of the starting composite


    EDIT:
    well i got it to work by going even higher up. I took Scenario A and put it into a composite
    and Scen B in another...
    then the Directory and file checks feed to 2 metachecks for a certain field.. each feeds into its own composite.
    While its not ideal, it works! lol

    THanks!
    Last edited by StaticFX; 05-15-2019 at 04:55 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •