locked
Insert URL of item created in new list item RRS feed

  • Question

  • I have a calendar list that when an item is added I need to add a list item to an issues list and include the url of the item added in the original calendar list.  I have the workflow that creates the list item in the issue list, but how can I obtain the URL and append that to text in the "Comments" column?

    Any help would be greatly appreciated.


    David Dye http://sqlsafety.blogspot.com/
    Saturday, November 13, 2010 5:50 PM

Answers

  • David,

    You did not mention what kind of workflow, so what follows is for a SharePoint Designer workflow.

     

    The URL to a calendar item looks something like this:

    http://yourservername/sites/yoursite/Lists/Calendar/DispForm.aspx?ID=4

    You will need to first build this string using the "Build Dynamic String" action. In this action type your text and the URL as above without the number at the end. Click Add Lookup and select "Current Item" and the ID field. Set the variable to a new variable such as "NewitemURL"  This should now look something like this:

      The new event is here: http://yourservername/sites/yoursite/Lists/Calendar/DispForm.aspx?ID=[%Calendar:ID%]

    Note: don't type the part after the "=", use the Add Lookup button.

    Then you can use the "Create list item" action and set the field you want to update to the new variable ("NewitemURL").

     

    If you are putting the text in a "rich text" field, then you can also add HTML to build a fancier link:

      <a href='http://maxsp2007/sites/training/Lists/Calendar/DispForm.aspx?ID= [%Calendar:ID%]'> Click here for the new item</a> 

     


    Mike Smith TechTrainingNotes.blogspot.com
    Sunday, November 14, 2010 4:32 AM

All replies

  • David,

    You did not mention what kind of workflow, so what follows is for a SharePoint Designer workflow.

     

    The URL to a calendar item looks something like this:

    http://yourservername/sites/yoursite/Lists/Calendar/DispForm.aspx?ID=4

    You will need to first build this string using the "Build Dynamic String" action. In this action type your text and the URL as above without the number at the end. Click Add Lookup and select "Current Item" and the ID field. Set the variable to a new variable such as "NewitemURL"  This should now look something like this:

      The new event is here: http://yourservername/sites/yoursite/Lists/Calendar/DispForm.aspx?ID=[%Calendar:ID%]

    Note: don't type the part after the "=", use the Add Lookup button.

    Then you can use the "Create list item" action and set the field you want to update to the new variable ("NewitemURL").

     

    If you are putting the text in a "rich text" field, then you can also add HTML to build a fancier link:

      <a href='http://maxsp2007/sites/training/Lists/Calendar/DispForm.aspx?ID= [%Calendar:ID%]'> Click here for the new item</a> 

     


    Mike Smith TechTrainingNotes.blogspot.com
    Sunday, November 14, 2010 4:32 AM
  • That was exactly what I was looking for.  Thank you!

     


    David Dye http://sqlsafety.blogspot.com/
    Monday, November 15, 2010 3:35 PM