This SharePoint tutorial, we will discuss, how to fix error Cannot cast LValue expression to type Microsoft.Activities.DynamicValue which comes in SharePoint Online visual studio 2015 workflow.
We were developing a workflow for SharePoint online site using visual studio 2015 as a SharePoint hosted add-in.
The error comes as:
Failed to translate expression because of the following error:
Cannot cast LValue expression to type ‘Microsoft.Activities.DynamicValue’
The error looks like below:
Cannot cast LValue expression to type Microsoft.Activities.DynamicValue
Here in this workflow, we have used one variable as string type like below:
We have used this variable in calling in the rest api in HttpSend activity. The error was coming because in the HttpSend it was expecting a variable of type Microsoft.Activities.DynamicValue<T>.
So to resolve the issue, change the data type of the variable from String to Microsoft.Activities.DynamicValue<T> like below:
You may like following visual studio workflow tutorials:
- SharePoint Hosted Add-in: Send Email to SharePoint group using visual studio workflow
- SharePoint Hosted Add-in: Send Email using visual studio workflow
- The field of type taxonomyfieldtype cannot be used in the query filter expression in SharePoint Online visual studio workflow
- SharePoint online visual studio workflow issue The ExpressionTranslationBuildTask task failed unexpectedly
- Difference between designer workflow and visual studio workflows
- SharePoint Workflow Initiation Form template missing in Visual Studio
- SharePoint Approved and Rejected buttons not appearing in task form in Visual Studio 2015 workflow
- SharePoint online visual studio 2015 workflow variable not available in various scopes
- Invalid text value. A text field contains invalid data error in visual studio 2015 workflow in SharePoint online
- Sorry you do not have access to this page while clicking on SharePoint custom workflow visual studio 2015
This tutorial, we learned how to solve Cannot cast LValue expression to type Microsoft.Activities.DynamicValue error in SharePoint visual studio workflows.
Bhawana Rathore is a Microsoft MVP (3 times in Office Apps & Services) and a passionate SharePoint Consultant, having around 10 years of IT experience in the industry, as well as in .Net technologies. She likes to share her technical expertise in EnjoySharePoint.com and SPGuides.com
Download SharePoint Online Tutorial PDF FREE!
Get update on Webinars, video tutorials, training courses etc.