LookUp Columns to link to documents in a different list

%3CLINGO-SUB%20id%3D%22lingo-sub-3100538%22%20slang%3D%22en-US%22%3ELookUp%20Columns%20to%20link%20to%20documents%20in%20a%20different%20list%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3100538%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20a%20request%20from%20a%20user%20where%20they%20want%20to%20directly%20associate%20documents%20from%20a%20sharepoint%20list%20to%20a%20file%20in%20a%20document%20library.%20I've%20been%20trying%20multiple%20different%20solutions%20and%20so%20far%20the%20closest%20I've%20gotten%20to%20success%20is%20with%20a%20LookUp%20column%20in%20the%20document%20library%20and%20formatting%20the%20column%20with%20custom%20JSON%20that%20I%20found%20elsewhere%20(see%20below).%20The%20problem%20I%20have%20is%20it%20isn't%20opening%20directly%20to%20the%20file%20itself.%20Changing%20the%20JSON%20I've%20had%20it%20link%20to%20different%20files%20but%20open%20the%20properties%2C%20make%20all%20the%20listed%20documents%20one%20combined%20link%20that%20opens%20to%20what%20seems%20to%20be%20the%20correct%20url%20for%20the%20list%20item%20but%20gives%20a%20blank%20screen%2C%20and%20the%20link%20opens%20the%20file%20in%20the%20document%20library.%20Does%20anyone%20know%20how%20I%20can%20achieve%20a%20document%20library%20lookup%20column%20that%20can%20contain%20a%20link%20to%20each%20item%20that%20is%20entered%20into%20it%2C%20even%20with%20multiple%20items%20in%20one%20file%20submission%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3COL%20class%3D%22%22%3E%3CLI%3E%3CSPAN%20class%3D%22%22%3E%7B%3C%2FSPAN%3E%3C%2FLI%3E%3CLI%3E%3CSPAN%20class%3D%22%22%3E%22%24schema%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22%22%3E%3A%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22%22%3E%22%3CA%20href%3D%22https%3A%2F%2Fdeveloper.microsoft.com%2Fjson-schemas%2Fsp%2Fv2%2Fcolumn-formatting.schema.json%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdeveloper.microsoft.com%2Fjson-schemas%2Fsp%2Fv2%2Fcolumn-formatting.schema.json%3C%2FA%3E%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22%22%3E%2C%3C%2FSPAN%3E%3C%2FLI%3E%3CLI%3E%3CSPAN%20class%3D%22%22%3E%22elmType%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22%22%3E%3A%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22%22%3E%22a%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22%22%3E%2C%3C%2FSPAN%3E%3C%2FLI%3E%3CLI%3E%3CSPAN%20class%3D%22%22%3E%22txtContent%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22%22%3E%3A%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22%22%3E%22%40currentField.lookupValue%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22%22%3E%2C%3C%2FSPAN%3E%3C%2FLI%3E%3CLI%3E%3CSPAN%20class%3D%22%22%3E%22attributes%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22%22%3E%3A%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22%22%3E%7B%3C%2FSPAN%3E%3C%2FLI%3E%3CLI%3E%3CSPAN%20class%3D%22%22%3E%22target%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22%22%3E%3A%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22%22%3E%22_blank%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22%22%3E%2C%3C%2FSPAN%3E%3C%2FLI%3E%3CLI%3E%3CSPAN%20class%3D%22%22%3E%22href%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22%22%3E%3A%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22%22%3E%22%3D'%3CA%20href%3D%22https%3A%2F%2Fabctenant.sharepoint.com%2Fsites%2FDemo%2FShared%2520Documents%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2Fabctenant.sharepoint.com%2Fsites%2FDemo%2FShared%2520Documents%2F%3C%2FA%3E'%20%2B%20%40currentField.lookupValue%22%3C%2FSPAN%3E%3C%2FLI%3E%3CLI%3E%3CSPAN%20class%3D%22%22%3E%7D%3C%2FSPAN%3E%3C%2FLI%3E%3CLI%3E%3CSPAN%20class%3D%22%22%3E%7D%3C%2FSPAN%3E%3C%2FLI%3E%3C%2FOL%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-3100538%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EDocument%20Library%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMicrosoft%20Lists%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
New Contributor

Hello,

 

I have a request from a user where they want to directly associate documents from a sharepoint list to a file in a document library. I've been trying multiple different solutions and so far the closest I've gotten to success is with a LookUp column in the document library and formatting the column with custom JSON that I found elsewhere (see below). The problem I have is it isn't opening directly to the file itself. Changing the JSON I've had it link to different files but open the properties, make all the listed documents one combined link that opens to what seems to be the correct url for the list item but gives a blank screen, and the link opens the file in the document library. Does anyone know how I can achieve a document library lookup column that can contain a link to each item that is entered into it, even with multiple items in one file submission?

 

  1. {
  2. "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  3. "elmType": "a",
  4. "txtContent": "@currentField.lookupValue",
  5. "attributes": {
  6. "target": "_blank",
  7. "href": "='https://abctenant.sharepoint.com/sites/Demo/Shared%20Documents/' + @currentField.lookupValue"
  8. }
  9. }
0 Replies