locked
How to get the new updated value of item in custome workflow SharePoint RRS feed

  • Question

  • Hi there,

    The WF is invoked once a record added in project list. Let me give you the steps in workflow I have built.

    1. Update the "ProjectName" field. (let say the value was "Microsoft" and now after updated is "Microsoft - PeterSains"

    2. call action "wait for field change current item".

    2. call custom workflow Activity. This "ProjectName" field will be used in custom workflow.

    3. Finish

    I then debug the custom WF and find that the value of "ProjectName" field is still "Microsoft", not "Microsoft - PeterSains" although the field had been updated on step 1.

    Can anyone suggest me? Thank you.


    Regards, Dedy
    • Moved by Mike Walsh FIN Wednesday, June 1, 2011 12:14 PM wf q (From:SharePoint - Development and Programming (pre-SharePoint 2010))
    Wednesday, June 1, 2011 6:30 AM

Answers

  • Hi,

     

    I understand that you want to get the newly updated column value in workflow steps .I have tried to create the workflow as what you described .The ‘Project Name’ column is  updated to “Microsoft - PeterSains" in step 2 . So I suggest you change the workflow to have a test:

    • Divide  the step 2 into two steps  .
    • Then  adding  a step to copy  the value to  a workflow Variable and then use the Variable in the custom workflow activity .You can achieve this by doing :

                                 1.     Add a step after ‘wait for field change current item’ called ‘Set workflow Variable’ .

                                 2.       Create a new variable to hold the value of ‘Project Name’ .

                                 3.       Change the column used in the custom workflow activity to the Variable .

     

    If you have any more questions ,please feel free to ask.

     

    Thanks ,


    Regards, Rock Wang Microsoft Online Community Support
    • Marked as answer by Clayton Cobb Wednesday, June 8, 2011 3:01 AM
    Thursday, June 2, 2011 10:38 AM

All replies

  • Hi,

     

    Did the field ever got indeed updated? If so, you might want to apply a pause (maybe a couple of minutes) before calling the custom workflow.

     

    - Corix

    Thursday, June 2, 2011 5:00 AM
  • I can't actually understand the steps you wrote.  You're saying your very first step is an "Update list item" instead of "Set Field in Current Item"?  After making this change, you then wait for field change?  What field do you wait for?  You didn't tell us that.  Then, your last step, which is also numbered "2" says you call a custom workflow activity, but you don't tell us what the activity is.

    I really have no idea what the workflow is doing other than trying to change the ProjectName field.


    SharePoint Architect || Microsoft MVP || My Blog
    Planet Technologies || SharePoint Task Force
    Thursday, June 2, 2011 6:22 AM
  • Hi,

     

    I understand that you want to get the newly updated column value in workflow steps .I have tried to create the workflow as what you described .The ‘Project Name’ column is  updated to “Microsoft - PeterSains" in step 2 . So I suggest you change the workflow to have a test:

    • Divide  the step 2 into two steps  .
    • Then  adding  a step to copy  the value to  a workflow Variable and then use the Variable in the custom workflow activity .You can achieve this by doing :

                                 1.     Add a step after ‘wait for field change current item’ called ‘Set workflow Variable’ .

                                 2.       Create a new variable to hold the value of ‘Project Name’ .

                                 3.       Change the column used in the custom workflow activity to the Variable .

     

    If you have any more questions ,please feel free to ask.

     

    Thanks ,


    Regards, Rock Wang Microsoft Online Community Support
    • Marked as answer by Clayton Cobb Wednesday, June 8, 2011 3:01 AM
    Thursday, June 2, 2011 10:38 AM
  • Hi guys,

    Sorry I forget to reply. I have found the solution which is using "Workflow - Variable". This is the same with Rock Wang said.

    @Corix, Yes, the field get updated after the WF is completed. I don't use pause action because it keeps looping. I found an article said that we need to install something else of hotfix again to fix the pause problem. That's why I use "wait for field change current time" action instead of pause action.

    Thank you guys for your help.


    Regards, Dedy
    Wednesday, June 8, 2011 2:37 AM