nerdexam
Microsoft

PL-500 · Question #31

You have an automation solution that uses a desktop flow. The flow reads data from a file that is stored on a user's machine and writes the data to an application. You import the solution to an…

The correct answer is D. Change the location of the file to a specific path that is not dependent on the signed-in user. When a desktop flow fails due to a 'path to file does not exist' error after being moved to a different user's machine, the issue is typically a hardcoded, user-dependent file path, requiring the file to be relocated to a universal or environment-independent path.

Support solutions and troubleshooting

Question

You have an automation solution that uses a desktop flow. The flow reads data from a file that is stored on a user's machine and writes the data to an application. You import the solution to an environment that is connected to another user's machine. The user reports that the flow fails. An alert indicates that the path to a file does not exist. You confirm that the file present on the user's desktop. You need to resolve the issue. What should you do?

Options

  • AMove the file to the user's documents folder.
  • BDelete and recreate the file.
  • CMove the file to the user's OneDrive storage.
  • DChange the location of the file to a specific path that is not dependent on the signed-in user.

How the community answered

(14 responses)
  • A
    7% (1)
  • B
    7% (1)
  • C
    7% (1)
  • D
    79% (11)

Why each option

When a desktop flow fails due to a 'path to file does not exist' error after being moved to a different user's machine, the issue is typically a hardcoded, user-dependent file path, requiring the file to be relocated to a universal or environment-independent path.

AMove the file to the user's documents folder.

Moving the file to the user's documents folder would still result in a user-dependent path (e.g., C:\Users\<username>\Documents), which would similarly fail when deployed to a different user.

BDelete and recreate the file.

Deleting and recreating the file does not address the fundamental issue of the file path being dependent on the user profile; the new file would still be created in a user-specific location.

CMove the file to the user's OneDrive storage.

Moving the file to the user's OneDrive storage, while a cloud solution, often still syncs to a user-specific local path and might not resolve the issue for a desktop flow seeking a fixed local directory unless specifically configured.

DChange the location of the file to a specific path that is not dependent on the signed-in user.Correct

Hardcoded file paths often include the user's profile (e.g., C:\Users\<username>\Desktop). When the flow runs on a different user's machine, the <username> part changes, making the path invalid; changing the file to a generic, non-user-specific path (e.g., C:\AutomationData) resolves this dependency.

Concept tested: Desktop flow file path management across users/environments

Source: https://learn.microsoft.com/en-us/power-automate/desktop-flows/best-practices

Topics

#Desktop flows#File paths#Troubleshooting#Deployment best practices

Community Discussion

No community discussion yet for this question.

Full PL-500 Practice