please consider adding a new input argument to the ‘Add Log Fields’ activity that allows users to hand in a collection Object (dictionary) as an alternative to adding the fields manually one by one, similar to how the ‘Add Queue Item’ activity allows users to supply a variable/argument of type ‘Dictionary(String,Object)’ instead of adding the required fields manually (ItemInformation vs. ItemInformationCollection).
This is currently not possible with the ‘Add log Fields’ activity. Consequently, there is no way to dynamically set the name of a log field.
Having this option would be of great value for all of my customers automations since we are looking to implement this functionality in their automations framework.
Yes please, would be really helpful to add log fields dynamically at runtime based on config or asset values.
For example inside framework we would to add stop watches dynamically for different process steps and overlapping scopes.
If we can log these values in separate log fields it makes evaluation a lot easier in Elastic-Search or Splunk.
But as the labels of the stopwatches is different from process to process we currently have to hardcode the labels.
I am also trying to create log fields dynamically,
I have created a dictionary(string,string) with my logs expecting that I can pass it to add log fields activity (either directly or by a loop).
But the activity has no properties, “all properties visible in the activity card”.
And the key only takes hard coded values.
Let me just add this one reasoning so you may consider it harder:
Hard coding is never best practice (even if it is the name of the logs fields).
So please! UiPath staff! You may just change that box that takes the “key” so it accepts expressions too, that way we could add our own dynamic values
(with a loop for example) even if there is no available dictionary argument going in.