cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Advocate I
Advocate I

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

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.

View solution in original post

5 REPLIES 5
Advocate I
Advocate I

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.

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

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.

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?

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.

View solution in original post

Helpful resources

Announcements
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Users online (4,990)