elsa-workflows / elsa-workflows/elsa-core

Elsa.Exceptions.CannotSetActivityPropertyValueException: An exception was thrown whilst setting 'ForEach.Items'.Failed to evaluate expression

Open
#2,943 14 comments 0 reactions 0 assignees View on GitHub
bug triaged
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.
![ReadActivity](https://user-images.githubusercontent.com/67507118/163716280-54c9c860-2f58-4bb5-ab2e-df3df2347d17.PNG)

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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.