I have a library with thousands of files. Each of these files is a shipment arrival.

I have a separate list that contains all of the ID numbers for the individual box/cargo within each shipment arrival. There is also a column that has the shipment arrival ID in this list.

How can I link these two together ??
I figured it would be incredibly easy but apparently not.

The screenshots show the MBL Column which is a unique value for each file in the library and the second one has multiple ID numbers (Title) for each MBL number (column named MBL 2). How can I relate these MBL Columns ?

Thanks for your help!

Parent library iList under library


This may be difficult to do now that you already have thousands of records in both lists. The best way to relate lists together in SharePoint is via Lookup Columns. Think of Lookup columns kind of like a foreign key relationship in a database. But unlike a foreign key, its not something that you add to an existing column, it is a separate type of column.

If you were setting up two new lists, you would start by adding a Lookup column to your Contenedores list that uses the Library MBL as its lookup reference, creating a many-to-one relationship from Contenedores to the Library, and then making that Lookup be a "Required" field. Then users entering new items in the Contenedores list would be forced to choose the MBL from the Lookup dropdown field to choose which Library document it is connected to.

In order to do this now that you already have thousands of items, you will need to add the Lookup column as described, but initially make it a "not required" column. Then you would need to write a script to iterate through all items in the Contenedores list and do a search to find the file in the Library with that MBL, then use that file's itemId to set the Lookup column value for the current Contenedores item. Once all items are updated, you can then make your Lookup column Required, then remove the "old" MBL column from that list.

  • Sharepoint is such a pain to work with. Thank you for your help! – Michael A Tondu Feb 25 '20 at 23:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.