locked
Link a created item to a lookup filed within a workflow RRS feed

  • Question

  • Hello,

    Problem:
    I have 1 list and 1 document library. I want to automatically create a folder in the document library for each list item in the list. Then a lookup field named "Activity Documents" in the list item should point to the created folder in the document library.

    Question:

    How can I do this in a workflow that runs automatically when a new list item is created?

    Currently I am ready to create the folder, but the workflow does not fill the lookup field...

    Many thanks in advance!
    - Sascha

    Friday, August 10, 2018 8:33 AM

Answers

  • Hi Sascha,

    Do you mean that you want a clickable hyperlink that can direct users to the related folder for each list item?

    If yes, then I misunderstood your request. Instead of using lookup column(you can delete actions related to lookup columns in the workflow), you can create a “Hyperlink” column named “Path” in your list.

    And then in the workflow, create a workflow variable named “folderPath”, set it to value “http://{your library address}/current item: Title”

    Then update your “Current item: path” to “workflow variable : folderPath”

    Best regards,

    Allen Bai


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.


    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.

    • Marked as answer by Sascha382 Wednesday, August 22, 2018 9:39 AM
    Wednesday, August 22, 2018 2:06 AM

All replies

  • Hi Sascha,

    For your first question, you can find in SharePoint Designer > workflow settings, and select “Start workflow automatically when a new item is created” as shown below.

    For your second question about lookup field is not filled by workflow, you need to look up for “ID” instead of “Title”(refer to https://sharepoint.stackexchange.com/questions/238093/assign-lookup-field-via-lookup-value-in-workflow):

    1. For your look up column, set “ID” as the input for this field, and select “Title to display as additional field.

    2. Create folder in document library

    3. Create a Integer Type variable called “LookupID” and then set the value as shown below.

    4. And then update your current item.

    When you create a new item named “test1”, the result will look like below:



    Best regards,

    Allen Bai


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.


    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.


    Tuesday, August 14, 2018 11:12 AM
  • Hello Allen,

    thank you for your solution. I will test it today and mark it as answer, if it worked for me :).

    Best regards,

    Sascha

    Monday, August 20, 2018 5:54 AM
  • Hello Allen,

    so I did as you described, but the list item is created and also the document folder. But it is not linked in the list item.

    I use SharePoint 2010 and SharePoint 2010 Designer.

    My workflow looks exactly the same as yours, but without the "Go to End of Workflow".

    Any idea why it does not link the created folder? Do you need further information for this?

    Thanks!!

    Monday, August 20, 2018 8:41 AM
  • Hi Sascha,

    Workflow 2010 does not have the "Go to End of Workflow" step, there is no need to worry about this. 

    Make sure to create this workflow in your list. Also make sure select "your document library" for the "Data source" option as below picture.

    If above does not work, please share your screenshots about your workflow and the list Item for helping us solve your issue.

    Best regards,

    Allen Bai


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.


    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.

    Monday, August 20, 2018 8:53 AM
  • Hi Allen,

    ok so I attach you my screenshots: (sorry, most of it is in german)

    1. Settings of the document library:
    2. Settings of the workflow:
    3. Steps:
    4. Step 1:
    5. Step 2:
    6. Step 3:

    Monday, August 20, 2018 11:16 AM
  • Hi Sascha,

    Do you mean that you want a clickable hyperlink that can direct users to the related folder for each list item?

    If yes, then I misunderstood your request. Instead of using lookup column(you can delete actions related to lookup columns in the workflow), you can create a “Hyperlink” column named “Path” in your list.

    And then in the workflow, create a workflow variable named “folderPath”, set it to value “http://{your library address}/current item: Title”

    Then update your “Current item: path” to “workflow variable : folderPath”

    Best regards,

    Allen Bai


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.


    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.

    • Marked as answer by Sascha382 Wednesday, August 22, 2018 9:39 AM
    Wednesday, August 22, 2018 2:06 AM
  • Hi Allen,

    THANK YOU! This worked :).

    But you did understand me right, I wanted to use the "LookUp" field as "Link" to the folder. But with the hyperlink field it does also work :). At the end it does the same thing.

    Regards,

    Sascha

    Wednesday, August 22, 2018 9:40 AM