Power Automate Desktop | Files and folders exercise | Open a workbook if if exists (otherwise show an error)

This exercise is provided to allow potential course delegates to choose the correct Wise Owl Microsoft training course, and may not be reproduced in whole or in part in any format without the prior written consent of Wise Owl.

Software ==> Power Automate Desktop  (18 exercises)
Version ==> Latest version
Topic ==> Files and folders  (2 exercises)
Level ==> Average difficulty
Subject ==> Power Automate training
Before you can do this exercise, you'll need to download and unzip this file (if you have any problems doing this, click here for help).

You need a minimum screen resolution of about 700 pixels width to see our exercises. This is because they contain diagrams and tables which would not be viewable easily on a mobile phone or small laptop. Please use a larger tablet, notebook or desktop computer, or change your screen resolution settings.

You want to write a flow to open a workbook if it exists:

Knife file

For example, the workbook Knife.xlsx exists in the above folder, so we can open it.


However, if a workbook doesn't exist your flow should display a suitable message:

File not found message

If you try to open the workbook called Spoon.xlsx in the above folder you should see a message like this.


To get this to work create a new flow called Is there a spoon with the following actions:

Action Notes
Set variable Create a variable called FileName and set its value to the name of the file you want to open (eg knife or spoon).
Set variable Create another variable called FilePath to hold the full path to this file, including the file name and .xlsx file extension (using a variable to store this will make the flow easier to read, and also let you reference this file path again easily).
If file exists Check if a file exists with this file path.  If it does, your flow should launch Excel, opening the file; otherwise your flow should use an Else action to display a message saying that the file was not found.

Test that your flow works with a valid and invalid file name, then save it and close it down.

You can unzip this file to see the answers to this exercise, although please remember this is for your personal use only. Our Power Automate exercises answers are provided as text files - you can see how to assemble these back into PAD flows here.
This page has 0 threads Add post