Convert System.Collections.Generic.List`1[System.SystemException] to string?

convert type System.Collections.Generic.ICollection<System.SystemException> to string.

Now I assign as below.

Email = mailBody.Replace(“[Error]”,String.Concat("Error Because Not found file in folder : ",in_Exception))

Output is show

Error Because Not found file in folder : System.Collections.Generic.List`1[System.SystemException]

I want output show

Error Because Not found file in folder : value in in_Exception

Please guide me about it.

Hi @fairymemay

in_Exception is typye of system.exception right?

if yes try this

mailBody.Replace(“[Error]”,String.Concat("Error Because Not found file in folder : ",in_Exception.Message))

add .Message in the end

Hope this Helps

Regards
Sudharsan

Do you have any reason to set the data type as the collection(Exception)?

Regards
Sudaharsan

@Sudharsan_Ka Use Add to Collection for keep SystemException as below.

image

Any idea for solve it?

Hi

Use a for each activity and pass the above variable and type argument as SystemException

And inside the loop use a assign activity like

Stroutput = item.Message.ToString+Environment.NewLine

Where stroutput is a string variable which will hold your string output

Cheers @fairymemay

@Palaniyappan Error as below.

Hi @fairymemay ,

Could yo try changing the TypeArgument to System.Exception?

Kind Regards,
Ashwin A.K

@ashwin.ashok Follow you suggest output as shown below.

image

If I want not shown System.SystemException :

But I want shown output Leads Propensity New to Insure , MAT PAT

Please guide me about it.

Try mentioning like this

item.Message.ToString in you first assign activity inside for each loop

Cheers @fairymemay

1 Like

Here is a sample workflow:

image

SystemExceptionLoop.xaml (6.0 KB)

Kind Regards,
Ashwin A.K

1 Like

Hope you got it resolved @fairymemay

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.