elsa-workflows / elsa-workflows/elsa-core
Elsa.Exceptions.CannotSetActivityPropertyValueException: An exception was thrown whilst setting 'ForEach.Items'.Failed to evaluate expression
- Dominant language
- C#
- Stars
- 7.9k
- Forks
- 1.5k
- Avg merge
- 15h 22m
- Merged PRs (30d)
- 114
Description
Hello @sfmskywalker,
I have a custom activity whose return type as "**DataRowCollection**".
```
[ActivityOutput(DefaultWorkflowStorageProvider = TransientWorkflowStorageProvider.ProviderName)]
public DataRowCollection Output { get; set; }
```
So I have designed a workflow such that forEach loop activity will read the data from custom activity.

So in this case getting the following error at ForEach loop activity:
>
> [WRN] Failed to run workflow 39fe328944604e83aebfb37fcc298af0
> Elsa.Exceptions.CannotSetActivityPropertyValueException: An exception was thrown whilst setting 'ForEach.Items'. See the inner exception for further details.
> ---> Elsa.Exceptions.ExpressionEvaluationException: Failed to evaluate expression
> ---> System.InvalidCastException: Object must implement IConvertible.
> at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
For this scenario using the **Elsa Version 2.6.0**
But same thing is working in **Elsa Version 2.4**
Contributor guide
Assessment
This issue has not been assessed yet.