Power Automate: String Building


StringBuilder is a .NET class for string-like objects.. These objects are mutable and handy when appending strings, but that’s .NET…

E.g., written in C#.

StringBuilder sb = new StringBuilder("Hello...", 25);
sb.Append("\nCiao...");
sb.Append("\nBonjour...");
sb.Append("\nHola...");

Without the StringBuilder class, these strings are instead tacked onto the end of a variable…

E.g., written in JavaScript.

var message = "Hello...";
message += "\nCiao...";
message += "\nBonjour...";
message += "\nHola...";

Although Power Automate is a Microsoft solution, the StringBuilder class isn’t available. Alternatively, strings are concatenated together…

E.g., concat expression in Power Automate.

concat("Hello...", "\nCiao...", "\nBonjour...", "\nHola...")

Conclusion:
Power Automate is powerful, but it is not a high-level programming language or a prototype language. Because of this, strings are built differently. The silver-lining? No need to worry about garbage collection…

“I feel safe in the midst of my enemies, for the truth is all powerful and will prevail.”

Sojourner Truth

#blacklivesmatter

Leave a comment