web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Best Practices for Kee...
Power Automate
Unanswered

Best Practices for Keeping an Error Log?

(0) ShareShare
ReportReport
Posted on by 200

Hello all,

 

I have some questions about the best practices for keeping an error log while cycling through a data table. I "Extract Data from Webpage" then open all URLs from the webpage and download them. Then I manually page to the next page and repeat until I run out of pages. Some of the documents randomly don't download. I want to keep an error log. To do this would it be best for me to (or even possible):

 

1. Store the data tables into excel and check to see if the file name is in downloaded then edit the excel based on if the file name exists?

 

2.  Attempt to add onto the data table directly

 

3. Is there another way to check if the files are being downloaded? I download using send keys NOT a download button.

I have the same question (0)
  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    Yes, you can save the datatable to excel and add what you want to Excel.

    There are "If File Exists" or "Wait for File (to Exist)" actions.  So, if you know the filename, you can check these conditions and then write an "x" to a corresponding excel cell.

     

    Good luck!

  • Srini007 Profile Picture
    3,327 Super User 2025 Season 2 on at

    HI @apaulso9 

     

    If you able to get the url of the file which you need to download the you can use Download from web action. all you need to provide is the URL of the file and specify the file name how you want

     

    So to wait until the download is complete you can use wait file action

     

    If you find this reply helpful, please consider giving it a LIKE AND

    If this reply answers your question or solves your issue, please ACCEPT AS SOLUTION

     

    Thanks,

    Srini

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    There are no generally accepted best practices for this. There are certain community-made frameworks for logging and error handling. I have created some myself and have delivered sessions on that in tech conferences. 

     

    The best practice in my opinion is to have your sub-flows in an On block error that handles all of the actions within a sub-flow the same way. Then have the On block error call a different sub-flow when an error occurs. This sub-flow is then responsible for creating the log. It should have a Get last error action to get the details of your error and then some functionality for logging those details.

     

    I personally prefer logging into text files and then feeding them to a monitoring software. But this part is really just a matter of preference. You can definitely write back to your Excel file, if you want to.

     

    I would generally suggest actually creating those entries in a data table that works better than Excel. You could use a SharePoint list, a Dataverse table or even a SQL database for that. Would then be easier to update the values with lower chances of application errors.

     

    Alternatively, you could use the work queue functionality and actually add each file to be downloaded as a separate item to your queue. Then, as you process them one by one, keep updating them. This would keep the queue items that are not processed easily visible and available.

     

    If you want to be able to restart your flow upon error and continue without processing items that have already been processed, I would suggest splitting your flow into two parts where:

    1. You read your Excel file and create items in your queue / database in the first flow
    2. You only read the queue / database and ignore the Excel file in the second flow. As you process your items, you update them in the queue / database. 

    The others who have replied to the topic have already explained how you can check if a file has been downloaded.

    -------------------------------------------------------------------------
    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

    I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard