SharePoint Developer Center > SharePoint Products and Technologies Forums > SharePoint - Workflow > Possible to create a secondary workflow that modifies tasks created by a primary workflow?
Ask a questionAsk a question
 

QuestionPossible to create a secondary workflow that modifies tasks created by a primary workflow?

  • Thursday, October 22, 2009 10:31 PMLiquidus Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I am wondering if this is possible:

    Somebody creates a task A that contains a field "Info A." A workflow starts and creates task B with "Collect Data from" action. The "Collect Data from" form can't be modified to include fields that lookups strings from Task A. But what if I made a secondary workflow that when a new item is created, checks if that item is a workflow item. Then if it is, it does the action "Update list item." However, there is no way to refer to fields in Info A and I can't use the same variables because this is a different workflow. Is what I am asking possible?

    edit: I realized that one way that Task B contains a reference to Task A in a field is the "Link" field. Tasks created by workflows contain a link to the original task that started the workflow. The name of the link is the same as the title of the original task. I tried setting a string variable to the field "Link" and have it look for a task where the title matches the variable but it didn't work.

    If only the task created by "Collect Data from" would also include a field like "ID of original task." That's exactly what I need.

All Replies

  • Friday, October 23, 2009 5:42 PMMart1n0 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Hi,

    is it a option to save the ID in another list and start from there a new workflow that looks in the first list for an item with that ID?


    Mart1n0
  • Friday, October 23, 2009 7:59 PManon asdf Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hyperlink fields contain data in the format "URL, friendly name"

    meaing URL COMMA SPACE LINKNAME

    which means your lookup won't work because it's comparing the entire contents of the hyperlink field with the task title.

    Workflow actions cannot manipulate strings, but you could try adding a calculated column to the tasks list, and use one of the WSS formulas or functions to truncate the hyperlink field to everything right of the SPACE.

    Then do a lookup to the calculated column, store that in a variable, and use the variable (now presumably just the link name) to match the other task's title.
  • Tuesday, November 03, 2009 10:56 PMLiquidus Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I realized that items created by a workflow have a hidden field called "Workflow Item ID" which contains the ID of the original task item the workflow was started from. This seems to be exactly what I need, but when I create the secondary workflow using the "Update List item" action, it does not run on the workflow item. I also can't start it manually on the workflow item. Am I missing something here?
    edit: Apparently this works if the two tasks are in different task lists, and only if the Update List Item workflow is started automatically.
  • Tuesday, November 10, 2009 3:38 AMbgreiss Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    where did you find the workflow item id?  I can't find it when using the update list item?

  • Tuesday, November 10, 2009 4:02 AMLiquidus Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    You actually can't change the workflow item id or view it in the list. You can only use it when creating actions in Sharepoint Designer. Watch part 5 of this video: http://office.microsoft.com/en-us/sharepointdesigner/HA102564171033.aspx