Skip to content

Instantly share code, notes, and snippets.

@cprima
Last active June 8, 2024 08:32
Show Gist options
  • Save cprima/5dad3b1e40a2731ab1b637f2ad15ba10 to your computer and use it in GitHub Desktop.
Save cprima/5dad3b1e40a2731ab1b637f2ad15ba10 to your computer and use it in GitHub Desktop.
UiPath Studio expression: Recursively Join Dictionary(String, Object)

watch in action:

IMAGE ALT TEXT

String.Join(", ", TransactionItem.SpecificContent.[Select](Function(kvp) _
kvp.Key.Trim() & ": " & _
If(TypeOf kvp.Value Is Dictionary(Of String, Object), _
String.Join(", ", CType(kvp.Value, Dictionary(Of String, Object)).[Select](Function(y) _
y.Key.Trim() & ": " & Convert.ToString(y.Value).Trim() _
) _
), _
If(TypeOf kvp.Value Is DataTable, _
"⚠ DataTable Encountered! ⚠", _
Convert.ToString(kvp.Value).Trim() _
) _
) _
)).Replace(" , ", ", ").Replace(", ,", ", ").Replace(Environment.NewLine & ", ", ", ").Replace(Environment.NewLine & Environment.NewLine, Environment.NewLine)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment