3 Replies Latest reply: Apr 29, 2014 6:27 AM by Razor Ramon RSS

    Check for File Marker and then Reload

      Hi everyone,

       

      I have an interesting question.

       

      I have a QV app that reloads regularly during the day at set intervals. It reads a csv  file as its main source of information as well as other files.

       

      I want the application to only reload when this main csv file has an indicator on the last row set to a Y. For example if the last row in Column1 is Y, then reload the entire application, but if it isn't don't reload the application, just leave the app in its current state.

       

      I have tried using the peek function to get this to work to get this to work as follows, but when my condition is unfulfilled the application ends up having no data as I am using an exit script.

       

      Test:
      LOAD *
      FROM
      [Book1.xlsx]
      (ooxml, embedded labels, table is Sheet1);


      let marker = peek('Col1' , -1, 'Test');

      exit script when marker <>'Y';   // Exit script when the file’s last row is not Y. If it is set to Y then reload the entire app


      Ideally, what I want is that if the last row of Column 1 is set to Y, then reload the application and update it with new data, but if this isn't the case, just keep the app in its previous state.

       

      Is this possible and if yes, can someone let me know how to do it?

       

      Many thanks