.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Dynmic updation of Variable name in Workflow 4.0

Posted By:      Posted Date: September 06, 2010    Points: 0   Category :Windows Application
Hi, I have created couple of variables & used them in workflow. Now suppose client changes the name of a variable then that has to be updated dynamically at all used places in that workflow. Any suggestions to achieve this...

View Complete Post

More Related Resource Links

Workflow persistence with a non-serializable variable

I'm using Entity Framework and WF4. I want to be able to persist a workflow but one of my variables in the workflow is an EF ObjectContext. Is there a way to make the workflow persist-able and when it re-hydrates, has a fancy new ObjectContext instance?Blades Don't Need Reloading...

Change Variable and Argument editor in workflow designer?

Is it possible, in Beta 2, to customize the behaviour of the editing grids use for entering data about a workflow's variables or arguments in the workflow designer?  Can I:- add my own custom column to the grid?- can I customize the variable type drop down editor? (e.g. have my own editor or otherwise filter the list of types)- can I change the "default" expression editor (and possibly remove it)?Thanks,Notre

how to trim a string value of a workflow variable using SharePoint designer.


I build a custom workflow using SP designer and have a need to trim a string value of a workflow variable. I tried using Calculation or Dynamic String builder but without success.

i store a user name type value into workflow variable called  check_name_var (string type). the logon name have this format  domainname\first_lastname 
how do i trim this value in check_name_var to only first_lastname.

Can anyone show me how or have suggest on how to accomplish this or is it possible to do this in SP designer?

Thanks for your help

Problem passing local variable for Approvers email in customised Approval workflow


I am building an Approval workflow using SPD and have used the Start an Approval Workflow task action.

The workflow works on a change register and looks up different list of approvers assigned to change items.

Using Local Variables, the look up assignment works fine.

My problem is that when I pass the Approvers variable to the email at the end of the workflow (the on Current Item with... part) it appears the variable in empty?

I have used the approach of adding a variable check in the content of the emails - as the workflow sends the emails anyway. The lookup works fine - it’s just the email at the end of the process that does not seem to be able to see the contents of the variables that are shown to be set earlier.

How to set or assign a Workflow Variable from data entered in a Form Web Part


Greetings -

I have a Form Web Part wherby the user enters a number

That number is sent to a subsequent Data View WebPart that uses the number to pull data from another source via a Web Service.

This all works fine. BUT

I'd also like for that number entered into the Form Web Part to be set as a Variable to be used until a new number is entered into the Form Web Part when the variable will be changed accordingly.

I need the newly set variable to be later used for filtering out data in other lists and views.

I also need the variable to automatically set a field in any newly created list item.

Gurus, please help.

How to assign a workflow argument with Direction=Property to a workflow variable?


I created an argument 'ArgTest' with Direction=Property and ArgumentType=String and a variable VarTest with VariableType=String.

I'd like to assign ArgTest to VarTest. Direct assignment (using Assign activity) doesn't work, because there is a compiler error "'ArgTest' is not declared. It may be inaccessible due to its protection level".

I tried to change definition of Assign activity in XAML using PropertyReference (which is System.Activities. ActivityPropertyReference) :

<Assign sap:VirtualizedContainerService.HintSize="242,58">
  <OutArgument x:TypeArguments="x:String">[VarTest]</OutArgument>
   <PropertyReference x:TypeArguments="x:String" PropertyName="ArgTest" />  

, but I got runtime error: "Object of type 'System.String' cannot be converted to type 'System.Activities.Activity`1[System.String]'."


From another reasons it's important for me to have Direction of ArgTest set to Property instead of In.

I believe the solution must be easy, so I feel like I'm missing a trick. Thanks in advance for any pointers.

How can I show data from a Workflow variable in a Collect Data from User form?



I have collected some data from a user in a SharePoint Designer workflow step and I now want to display that data in a second "Collect Data from User" form at a subsequent step in my workflow.  How can I add the content of my Workflow data variable in the Collect Data from user form?

This guy says he has done something similar but does not explain the detail: http://www.mstechblogs.com/paul/spd-workflow-collect-data-from-a-user-modify-the-generated-task-form

I'm keen to hack at the aspx form in SPD but I really need the particular line of code that will do it as I'm not a developer.

Your help is greatly appreciated!

How can I show data from a Workflow variable in a SharePoint Designer Collect Data from User form?



I have collected some data (a comment) from a user in a SharePoint Designer (SPD) workflow step and I now want to display that comment in a second "Collect Data from User" form at a subsequent step in my workflow.  How can I add the content of my Workflow data variable, or even data from my original item, in the Collect Data from user form?

The Collect Data from user form is generated out of the Workflow Tasks list and only contains the url of the item where I could store the comment and which has the workflow attached to it.

This guy says he has done something similar but he appears to only use the URL and static info and does not explain the detail in any case: http://www.mstechblogs.com/paul/spd-workflow-collect-data-from-a-user-modify-the-generated-task-form

I'm keen to hack at the aspx form in SPD but I really need the particular line of code that will do it as I'm not a developer.

Your help is greatly appreciated!

Assign SharePoint list sum total value to a sharepoint designer workflow variable


I have a similiar question and get answered but the solution is possible but not simple as I thought.   So I like to ask it again

I use SPD to build a workflow and I need to be able to get a SharePoint list column sum total value to assign to one of the workflow variable.

Do anyone have a similar situation and have came up with a solution , please share

Environment is  MOSS 2007 /SP2.

Thanks you so much in advance.


How to update Workflow variable cross-workflow in SharePoint Designer 2007?


Hi All,

created two SharePoint designer 2007 workflow, which attached WF1 to Pages and WF2 Workflow Tasks List,

then I created a workflow variable in WF2,

can I update the variable in WF2 by action in WF1?

appreciated any help, thank you.

Variable Workflow Template


Question. I'm developing a workflow with 6 approvers. The first approver could be one of ten engineers, while the remaining are single, fixed approvers.

Is it possible to create a template meeting that criteria or would the initiator have to create a new workflow each time?

Thanks for your help.

Regards, Silvana

DynamicActivity cannot reference a variable defined in parent workflow


I have a custom activity that executes a workflow by creating a DynamicActivity instance that is then invoked using WorkflowInvoker.

Prior to invoking the DynamicActivity instance, I set up its Properties using a dictionary of Arguments I have populated using the DynamicArgumentDialog. One of the DynamicActivitiy properties is an out argument and I assign it an an expression that references a variable defined in the parent workflow. The intention of this is that the DynamicActivity workflow will attempt to write a result to the variable defined in the parent.

Here's the code that initialises the Proprerties collection (out arguments only):


 foreach (string argumentKey in Arguments.Keys)
    if (da.Properties.Contains(argumentKey))
     if (da.Properties[argumentKey].Type.GetGenericTypeDefinition().BaseType == typeof(OutArgument))
      da.Properties[argumentKey].Value = Arguments[argumentKey];      

   WorkflowInvoker invoker = new WorkflowInvoker(da);


where Arguments is Dictionary<string, Argument>, populated using DynamicArgumentDialog.

However, when Invoke is called I get the exception:

The following errors were encountered while processing the workflow tree:
'VisualBasicReference<Int32>': Compiler error(s) encountered

When creating a custom workflow activity, how can I specify a workflow variable as a parameter?


I have a functioning custom workflow activity developed in VisualStudio, deployed successfully and visible in SharePoint Designer.

My problem is that I'm trying to collect a Workflow Variable of type Number from SPD as a parameter for the activity, and can't find the right combination of values for my .ACTIONS XML file...

As a simple example/test WF Activity, I'm trying to just increment a variable and return the new value to another variable. Since this is an increment (variable++) I want both variables to be defined of type Number in SPD, not String. For an example of what I want, take a look at the "Do Calculation" OotB WFA in SPD and it's (Output To _variable:_ ) , where clicking on the parameter placeholder displays a drop-down list of all Workflow Variables in the current WF.

If I set the FieldBind attribute DesignerType to Text (and the Parameter attribute Type to "System.String, mscorlib") then I get the textbox with the "..." and "fx" buttons, allowing me to select any Workflow Data variables.

But if I change that to Integer and "System.Int32, mscorlib" I get the same control, but nothing is available in the Workflow Data variables list. And if I use FieldBind.DesignerType="ParameterNames" and Parameter.Type="System.int, mscorlib" I get an empty drop-down-

Local variable scoping in C#

In my previous post, Compiler-generated scopes for local variable declarations, I briefly touched on the issue of multiple meanings applied to the same name. In this post, I'll aim to flush out the compiler's rules with regards to binding names in their local scopes.

Compiler-generated scopes for local variable declarations

I was tasked with understanding and fixing a bug on error reporting with foreach iteration variables the other day, and it got me thinking about local variable scoping rules in C# in general. First, the bug.

Free Series of SharePoint Workflow How-to Videos

This is the series of "How to" Document Workflow with SharePoint using Visual Studio 2008 (using the .NET Framework 3.0 for backward compatibility to Visual Studio 2005). I have created video's that show the most common requests that I have seen around MOSS/SharePoint 2007 workflow & document workflow.

Retrieving a variable from a previous page



I'm looking to have a search page where a user will select an item from a listview, then then taken to another page that wil display data based on their original selection.

A user will type in a string and be presented with a list of usernames that are like that string, when they select a user name who's profile they would like to view I would like the page that they're taken to, to be that users profile.

How would I transfer the variable from the search page to the profile page, and when I work on the profile page, how can I access that variable?


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend