cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
DawgPoundMBA1
Level: Powered On

Selecting values in a lookup column based on doc library

I need assistance in building the final phase of my flow.  Here are a few facts followed by a question.

 

I have a list of requests for which I use the item ID as the unique identifier.  Upon item modification my flow takes the attachment from the item and moves it to the document library and deletes it.  The flow populates relevant meta data in the document library, including the request ID so there is a clear association between the original list and the document library (one to one or one to many).  I am able to use the 'link to item' value to send back to the original item and update a text field, but it is the full doc library item URL, not the name, (so its not concise) and it overwrite so only the last one is stored.

 

I probably could work the prior a bit more by looping through and writing to an array variable with name & URL info within the array, but that isn't ideal.  Rather, I'd prefer to have a lookup column in the original list based on the document library that selects any item in the lookup where the meta data request ID sent in the earlier flow matches the current list item ID.  Thus if four attachments are related to the current request then they will all be selected.

 

How do I create a flow that will select the related documents in the lookup column based on the item ID?  How do you suggest I approach this?

1 ACCEPTED SOLUTION

Accepted Solutions
DawgPoundMBA1
Level: Powered On

Re: Selecting values in a lookup column based on doc library

I figured out a solution in case someone else runs into this issue.  I created a flow triggered when the primary list is modified.  The workflow takes the item ID of the primary list and puts it in a variable, then goes to the document library and loops through each item that matches the variable and writes all matches to an array variable.  The value it writes to the array is: <a href="[Link to Item]">[Title]</a> where 'link to item' and 'title' are dynamic content values. This gives an array of hyperlinks to all related files.  Finally, I used the 'Join' function in flow for a rich text field called 'Related Documents' where the delimiter is '<br>' which puts each item on its own line.

5 REPLIES 5
DawgPoundMBA1
Level: Powered On

Re: Selecting values in a lookup column based on doc library

I'm bumping my post due to the many spam messages regarding music that are in this forum.  I'll delete once the spamming is stopped.

DawgPoundMBA1
Level: Powered On

Re: Selecting values in a lookup column based on doc library

Anythoughts anyone?  How to associate multiple files from a document library to a list item based on common value between the two.

Community Support Team
Community Support Team

Re: Selecting values in a lookup column based on doc library

Hi @DawgPoundMBA1,

 

Could you share more details on your scenario for better understanding?

It seems that you have already created a flow between the SharePoint list and library, how is it created?

What’s the common column between the list and the library?

I suppose that flow 1 will be used to take attachments from the item and save the attachments to document library. If possible, please add a Number column for “List item ID” and consider it as the common column.

In flow2, when there are some updates in the library, get items from the list, if “List item ID” equals to the item ID in the list, then update the corresponding items.

Hope this could be your reference.

 

Best regards,

Mabel

 

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
DawgPoundMBA1
Level: Powered On

Re: Selecting values in a lookup column based on doc library

Hi Mabel - Thanks for the response.

 

My first flow does take the attachment from the request list, saves it in the doucment library, and pass the the item ID value to a meta data field in the document library called requested ID.  That already is working fine.

 

I am unclear on your flow 2 response.  Are you saying to create a flow that after trigger on the request list & doc library lookup column to create a formula in flow for that column that says get items from doc library?  Will that get items select the proper choices in the document library lookup column?  How are you suggesting that the matching values from the document library are presented in the request list?

DawgPoundMBA1
Level: Powered On

Re: Selecting values in a lookup column based on doc library

I figured out a solution in case someone else runs into this issue.  I created a flow triggered when the primary list is modified.  The workflow takes the item ID of the primary list and puts it in a variable, then goes to the document library and loops through each item that matches the variable and writes all matches to an array variable.  The value it writes to the array is: <a href="[Link to Item]">[Title]</a> where 'link to item' and 'title' are dynamic content values. This gives an array of hyperlinks to all related files.  Finally, I used the 'Join' function in flow for a rich text field called 'Related Documents' where the delimiter is '<br>' which puts each item on its own line.

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 169 members 4,874 guests
Please welcome our newest community members: