What to do if the specified file does not exist.(Power Automate Desktop)

Japanese version.

When using the Load File action, the

If the target file does not exist, an error may occur and must be dealt with.

How to deal with it

existence check

The existence of the file is checked in advance with the "If the file exists" Action.

If you want to notify users, select Doesn't exist for If file exists and specify the file path to be checked. The user notification action will be placed below it.

And additionally, select Exists for If file and place an action to use the file under it.

If the file does not exist, it is also useful to use Display select dile dialog Action and ask the user to specify a different file.

Wait until the file is created

Drag Wait for file Action to the workspace if files may be created at different times.

Then set Wait for file to be to Deleted.

This will put the file in a waiting state until it is created.

Use error (exception) handling

Error (exception) handling is also possible to some extent.

Drag On block error Action to the workspace and select Continue flow run and set Exception handling mode to Go to End of Block.

In the flow below, if the file does not exist, the processing in the block after Read from CSV file Action is not performed.

However, the part after 4, which is outside the block, will be performed.