Automate

 View Only
  • 1.  Chained scripts - I only want the 2nd script to run if condition met

    Posted 02-04-2022 10:21
    Hi Winshuttle users, I would like to know the best way to manage only running the 2nd script when a condition is met, for example if column x is empty or something like this. Or, if the chained script will need to "run" how to do this so it does nothing actually? Thank you for your help with this.

    ------------------------------
    Kelly Nicholson |
    Yara UK Limited |
    ------------------------------


  • 2.  RE: Chained scripts - I only want the 2nd script to run if condition met

    Posted 02-07-2022 03:08
    Hi Kelly, I would suggest to wrap whole 2nd Script in column based IF Condition :). 2nd Script will run anyway but it will go fast through lines which does not met IF conditioning :).

    ------------------------------
    Robert Dudziak | Senior Procurement Operations Analyst
    Kimberly-Clark Corporation |
    ------------------------------



  • 3.  RE: Chained scripts - I only want the 2nd script to run if condition met

    Posted 02-08-2022 08:50
    I agree with this method! Koen's method below would work also, but the caveat there is if the formula breaks for any reason, you will wind up executing rows you wish to ignore. The IF condition is the better option in my opinion.

    ------------------------------
    Vanessa Kutasi | Application Analyst II
    IDEXX | New England WUG Leader
    ------------------------------



  • 4.  RE: Chained scripts - I only want the 2nd script to run if condition met

    Posted 02-08-2022 04:47

    I have the same situation altough for me the script will always run but will to skip certain (or all) rows. I'm running several scripts on different tabs from the same excel sheet.

    I've put an excelformula in the 'Run Log' column which puts a value (like 'Do not execute') if a certain condition is met. Otherwise the cell is left blank.

    Then I run all scripts in the chain with setting 'Run only unprocessed'. That way all rows with a value in the 'Run Log' column are skipped.



    ------------------------------
    Koen Everaerts |
    Aveve NV | +32 16 24 26 26
    ------------------------------



  • 5.  RE: Chained scripts - I only want the 2nd script to run if condition met

    Posted 02-15-2022 11:26
    Hi Koen, thanks, that's a good approach and I will steal with pride for future solutions :-)

    And thank you Robert & Vanessa, great you advise to use the IF condition which is what we have applied but it doesn't seem to work in this case.

    The example we have is we have two transactions which we need to update, in some cases we only need to update the first transaction and in some cases (when a value is not equal to the skip indicator in a specific column in the template) we need to update a 2nd transaction in addition. So we need the first script to run always, but the 2nd script, which I have chained and has an IF condition which states run if column is not equal to skip indicator and this is applied to the whole script apart from the 3 initial log columns - Run Log, Extended Log & Validate Log. 
    When the second script runs it doesn't stop amd gives the message 'Data was saved' in the run log. I've not experienced that the 2nd script runs even at the end of the populated rows. This is strange as it keeps going until I stop it by closing the excel (I am acting as a Runner as we use Evolve to publish our solutions to business).
    Could someone share a screenshot of the expert view of an additional script which contains the IF condition, maybe I have it applied incorrectly.

    ------------------------------
    Kelly Nicholson |
    ------------------------------