locked
How to retrieve the List GUID and List URL in a Sharepoint 2010 workflow without hardcoding it? RRS feed

  • Question

  • I am making a sharepoint 2010 workflow that generates a link to a ics file so that it can create an outlook appointment, but the problem is I need to pass the list path and GUID in the string builder to create the link. I don't want to hardcode those values in (and I don't want to create a column and put those values in), how can I access those values in the workflow?

    Thanks

    Thursday, September 20, 2012 3:15 PM

Answers

  • 1. Choose 'Set workflow variablie to'...

    2. Click the [fx] button

    3. Choose the following values:
      a. Data Source: Workflow Context
      b. Field from source: Current Site URL

    (This is only one example of how to use it.  There are many others.)


    Steve Clark, MCTS | Twin-Soft.com
    Easy Bins Dumpster Rentals of Northern VA. (Specializing in driveway-sized roll-off dumpsters.)
    Be sure to click one of them there forum buttons that artificially inflates my narcissitic ego... I mean gives me points.

    Wednesday, September 26, 2012 1:30 PM
  • Hey ryands

    workflowProperties is an object inside a workflow project, it's usually declared as a variable of type SPWorkflowActivationProperties and it's a property configured to onWorkflowActivated activity (the first activity on the workflow)


    Pedro Aparcana

    Wednesday, September 26, 2012 3:10 PM

All replies

  • Next time, ensure to post in the 2010 forums, else you will be visited by the Dryer Gnomes who will steal half of your socks.  

    There ought be a way to extract the path from an item.  I remember doing this in SPD2007, so would imagine it can happen in SPD2010.  Using the workflow variables to build a dynamic string, or something like that. (Sorry, too lazy to try it right now.)


    Steve Clark, MCTS | Twin-Soft.com
    Easy Bins Dumpster Rentals of Northern VA. (Specializing in driveway-sized roll-off dumpsters.)
    Be sure to click one of them there forum buttons that artificially inflates my narcissitic ego... I mean gives me points.

    Friday, September 21, 2012 2:26 PM
  • Oops i put this in the wrong forum by accident.

    Anyways, I do need the guid and url of the list and not the item if you didn't know that.

    Friday, September 21, 2012 9:06 PM
  • Not sure about the GUID, but I believe you can extract the URL (aka the Path) from within an SPD Workflow.  Try it out and ping with further questions.


    Steve Clark, MCTS | Twin-Soft.com
    Easy Bins Dumpster Rentals of Northern VA. (Specializing in driveway-sized roll-off dumpsters.)
    Be sure to click one of them there forum buttons that artificially inflates my narcissitic ego... I mean gives me points.

    Monday, September 24, 2012 1:06 PM
  • hi

    I believe you can use workflowProperties.ListId and workflowProperties.ListUrl to get those values. 

    Regards,

    Pedro


    Pedro Aparcana

    • Proposed as answer by Pedro Aparcana Wednesday, September 26, 2012 4:57 PM
    Tuesday, September 25, 2012 8:30 PM
  • How do I access those values in the workflow?
    Wednesday, September 26, 2012 1:15 PM
  • 1. Choose 'Set workflow variablie to'...

    2. Click the [fx] button

    3. Choose the following values:
      a. Data Source: Workflow Context
      b. Field from source: Current Site URL

    (This is only one example of how to use it.  There are many others.)


    Steve Clark, MCTS | Twin-Soft.com
    Easy Bins Dumpster Rentals of Northern VA. (Specializing in driveway-sized roll-off dumpsters.)
    Be sure to click one of them there forum buttons that artificially inflates my narcissitic ego... I mean gives me points.

    Wednesday, September 26, 2012 1:30 PM
  • Hey ryands

    workflowProperties is an object inside a workflow project, it's usually declared as a variable of type SPWorkflowActivationProperties and it's a property configured to onWorkflowActivated activity (the first activity on the workflow)


    Pedro Aparcana

    Wednesday, September 26, 2012 3:10 PM
  • that worked thanks.
    Wednesday, September 26, 2012 3:15 PM