UiPath Documentation
autopilot
latest
false
Autopilot user guide

Refactor coded automations

Refactor selected code in a coded automation using Autopilot's Generate Code action in Studio, with prompt examples for common refactoring goals.

Autopilot helps you enhance your code through refactoring. You can offer Autopilot instructions to improve selected code by identifying redundancies, simplifying complex methods, or maintaining consistent coding standards, among others.

Prerequisites

  • Studio 2024.10.1 or higher.

Refactor code

  1. Select the code you want to refactor.
  2. Open the context menu and select Generate Code.
  3. Enter instructions describing how Autopilot should refactor the code.

Prompt examples

  • "Refactor the method below and make it more performant."

Best practices

  • Specify the language and the refactoring goal clearly, for example "Refactor this C# method."
  • Keep prompts short and direct.
  • Prerequisites
  • Refactor code
  • Prompt examples
  • Best practices

Was this page helpful?

Connect

Need help? Support

Want to learn? UiPath Academy

Have questions? UiPath Forum

Stay updated