How to get DisplayName of an activity?

Hi

I can’t get DisplayName of an activity my way. I know that activity name is also stored in exception.Source variable but not all the time. Sometimes, there is something like “SAP Window” etc. in this variable so I wanted to do that through exception.Data.Values and match DisplayName value. I tried to get it with Each Loop with ICollection but it doesn’t work and there is no variable such as “UiPath.Service.Api.FaultedDetails”.

Could you please help me?

DisplayName.zip (8.1 KB)

Thanks.

2 Likes

Did you find the solution to this?

2 Likes

I have the same issue and cannot find the answer.

This is an object of type “FaultedDetails” which you can get the values from it using System Reflection.
You can loop throw SystemError.Data using “System.Collections.DictionaryEntry” but you can get the value directly as below:

  1. Create a new variable of type [Object] called “FaultedDetails” (or any name obviously!) and assign it the below value:
    "SystemError.Data.Item(“FaultedDetails”)

1

  1. Write or assign the value you want directly. The below example is for getting the workflow file:

FaultedDetails.GetType().GetProperty(“WorkflowFile”).GetValue(FaultedDetails, Nothing).ToString
2

The other two property names are “ActivityId” and “DisplayName”

3 Likes