Skip to content
Menu

Free tutorial

File handling in Power Automate for desktop

The local accountant, Hanne Hansen, needs help in sorting her files.

Anders Jensen Automation & AI Instructor

Intro

The local accountant, Hanne Hansen, needs help in sorting her files.

What you will learn

  • Primarily:
    • Work with files
    • Create a log
  • Secondarily:
    • For each loops
    • Date and time
    • Lists

Client Name

Accountant Hanne Hansen

Process Name

FileSorting

Description

The one-person company Accountant Hanne Hansen spends valuable time sorting its files day after day. You'll create an RPA process that solves this:
  • Download the example files here
  • Create an automation that sorts each file type (Notepad, Word, and Excel) into the right folder
    • Beware: There is a zip-file, which you need to extract initially
  • Create a log that includes:
    • Time-stamp
    • The number of sorted files
    • How many individual files got sorted (Notepad, Word, and Excel)
    • The full path of each file

Hints

  • Unzipping
    • Get files in folder
      • Collect the file names in a list
    • For each
      • Iterates the list
    • Unzip files
    • Delete file(s)
  • Sort files
    • Get files in folder
    • For each
    • If else
    • Move file(s)
  • Logging
    • Create three new lists (one for each file type)
    • In each branch in the If, add an Add item to list
    • Get current date and time
    • Convert datetime to text
    • Set variable (to be able to create a log in multiple lines)
    • Write text to file

Video Guide

More tutorials

  • Microsoft Power Automate Desktop

    The complete lesson series for Microsoft Power Automate for desktop: from installation and your first flow to variables, Excel, browsers, file handling, and…

    Read more →
  • Power Automate Desktop Beginners Course [2022]

    Free tutorial: Power Automate Desktop Beginners Course [2022]. Video walkthrough, exercise files, hints, and solutions.

    Read more →
  • Excel in Power Automate for Desktop

    Sespi Cola want to automate how their salespersons are performing.

    Read more →