UiPath Documentation
maestro
2.2510
true
Maestro user guide

Transitioning from C# to JavaScript expressions

Migrate Maestro processes from C# to JavaScript expressions as UiPath deprecates C# for a unified scripting experience.

Purpose​

This page helps you move existing Maestro processes from C# expressions to JavaScript expressions. UiPath is deprecating C# as an expression language in Maestro to provide a unified scripting experience, modern syntax highlighting, and broader compatibility with other Automation Suite components.

What this change means​

  • C# expressions continue to work and are fully supported until they are officially removed in a future release.
  • New Maestro projects and features now use JavaScript expressions by default.
  • We recommend that you migrate existing expressions to JavaScript to ensure forward compatibility.

If you see a yellow alert message, it means your project currently uses the older C# expression editor. You can continue working with your existing expressions, but we recommend starting to migrate them to JavaScript.

Key differences at a glance​

ConceptC# syntaxJavaScript syntaxNotes
String concatenation"Hello " + name"Hello " + nameIdentical in both languages.
Case conversionuserName.ToUpper()userName.toUpperCase()Method name uses lowercase toUpperCase.
Equalityamount == 100amount === 100Use === for strict equality.
Null or emptystring.IsNullOrEmpty(x)!x or x === ""JavaScript treats null and undefined as falsy.
Collections lengthitems.Countitems.lengthProperty name differs.
Conditional expressionamount > 5000 ? "High" : "Low"amount > 5000 ? "High" : "Low"Same syntax in both languages.
String interpolation$"Hello {name}"`Hello ${name}`Use backticks (`) for template literals.
Date nowDateTime.Nownew Date()Use the JavaScript Date object.
MathMath.Round(x)Math.round(x)Function names are lowercase in JavaScript.

How to update existing expressions​

  1. Open the Expression Editor for each affected property or gateway condition.
  2. Copy the C# expression and adapt it using JavaScript syntax (refer to the table Key differences at a glance).
  3. Use Test in the editor to confirm the result.
  4. Save and republish your process.
Tip:

When migrating complex formulas, validate variable names and ensure all string comparisons use ===.

Example migration​

Before (C#)​

vars.total = items.Sum(x => x.Price);
if (vars.total > 10000) vars.priority = "High";
vars.total = items.Sum(x => x.Price);
if (vars.total > 10000) vars.priority = "High";

After (JavaScript)​

vars.total = items.reduce((sum, x) => sum + x.Price, 0);
if (vars.total > 10000) vars.priority = "High";
vars.total = items.reduce((sum, x) => sum + x.Price, 0);
if (vars.total > 10000) vars.priority = "High";

Frequently used equivalents​

Common actionC#JavaScript
Check multiple conditions(a && b) || c(a && b) || c
Parse numberint.Parse(x)parseInt(x)
Convert to stringvalue.ToString()String(value)
Round to 2 decimalsMath.Round(x, 2)Number(x.toFixed(2))
Compare ignoring casename.Equals("UIPath", StringComparison.OrdinalIgnoreCase)name.toLowerCase() === "uipath"

Testing tips​

  • Use the Test button in the Expression editor to confirm outputs.
  • Watch for differences in null handling and type coercion (=== vs ==).
  • Strings and numbers automatically convert in JavaScript; use explicit casts if accuracy is critical.

Next steps​

  • Start writing new expressions in JavaScript.
  • Update existing processes over time using this guide.
  • Plan for migration using either Autopilot or manual translation.
  • Track future release notes for the eventual removal of C# expressions.

Was this page helpful?

Connect

Need help? Support

Want to learn? UiPath Academy

Have questions? UiPath Forum

Stay updated