Menu Close

Excel row does not exist in Flow

(ESTIMATION TIME: 1 MINUTES)

So here I am working on another PowerApps app. My app should work across different tenants so I’m using Flow HTTP request/response for data sync purposes. For a storage I’m using an excel file on my OneDrive for Business.

One of my Flow use cases to cover was to get JSON data from HTTP request and:

  • if row exists – update it
  • if row doesn’t exist – create a new one

I’ve quickly searched the web looking for most recommended approach and found this article where a promoted solution suggest to:

  • Get all rows from an excel file
  • Filter all rows looking for a specific one
  • Using condition action split a flow to “have been found” and “haven’t been found” paths

And this is actually a quite good approach…unless there is nothing much happening after a conditional split. For better understanding consider following:

  • Get all rows from an excel file
  • Filter all rows looking for a specific one
  • Conditional split:
    • Have been found -> do action A -> finish
    • Have been found -> do action B -> finish

Better approach (in specific cases)

Above bullet point list describe a pretty simple scenario but represents exactly my need. And because of its simplicity I was wondering “do I really need to get ALL rows only to find out if there is the one I’m looking for?”. The answer was obvious: “no, I don’t”.

The trick is to use error handling capability of Microsoft Flow along with Termination action with “Succeeded” status.

Result when my HTTP trigger received a row guid that does not exist:

I hope you find this short article helpful in your Flow implementations.

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *