Forum Discussion

Dimps's avatar
Dimps
Frequent Visitor
2 years ago

Power Automate with condition.

I've developed a Power Automate for managing inventory. After refreshing the inventory dataflow, I also refresh the dataset linked to it. Typically, the dataset refreshes within 15-20 minutes, but occasionally it takes several hours. I'm looking to implement a condition where if the refresh exceeds one hour, the dataset refresh is automatically canceled. I'm unsure how to implement this condition and would appreciate any assistance. In Terminate, I have kept Parameters Status Failed and in settings I have selected "Has timed out". In refresh a dataset, for testing purposes, I have kept 5 mins but still the dataset is running beyond 5 mins, it is not cancelling.Thank you!

 

 

5 Replies

  • That's not how this works.  Your request for a dataset semantic model  refresh is asynchronous. Meaning your flow will not wait for that step to complete.  You have to implement the 1 hour delay yourself. At the end of the delay you can check in the refresh history if the latest record has an end date or not.

    • Dimps's avatar
      Dimps
      Frequent Visitor

      Thank you lbendlin, I changed the settings for 'Refresh a dataset" to one hour, with the termination status set to "cancelled." Will this terminate the dataset refresh if it exceeds one hour?

       

       

      • lbendlin's avatar
        lbendlin
        Icon for Super User rankSuper User

        No, this is totally unrelated. Your flow will continue to run. It will not wait for the completion of the refresh.

         

        If you want a one hour delay you need to add that delay yourself, as a separate action.

  • Dimps's avatar
    Dimps
    Frequent Visitor

    Thank you lbendlin! I di dnot understand, can you please shre the screen shot about how can I add that action separatley - "if the dataaset refresh is taking more than an hour than terminate the dataset refresh."