Forum Discussion
Phil_COB
Aug 09, 2019Copper Contributor
Document Lookup Column Link
Hi, all, In SharePoint Online I have a doc library (Reference Docs) and a list (Projects). The goal is for users to choose a doc from a lookup drop-down in Projects, which, when clicked, will...
Vernon Jones
Sep 09, 2019Copper Contributor
I found the same issue. In the Classic UI, lookup documents opened directly from the list, but in Modern, clicking the document takes you to the document properties, which is not very useful.
Also, if you open the list item and click the lookup document, it opens a property window, but clicking the link to the document name doesn't do anything. The only way to open the document is to right-click and open in a new tab.
It appears that the functionality for opening lookup documents didn't come over from Classic. Not opening from a property window may be a bug.
Phil_COB
Sep 09, 2019Copper Contributor
Thanks for the reply. I figured this was the case.
I did get it to work, but it took a workflow and JSON coding to extract the link elements then combine them to recreate the link.
What was once simple is now way too complicated...
If you want details, please let me know.
- Vernon JonesSep 10, 2019Copper Contributor
I'm not sure if I'll go that route, but I'm curious, so yes, please send the details.
Thanks!
- Phil_COBSep 10, 2019Copper Contributor
Hi,
A workflow copies the link from the Name column to a "linked" column in the doc library. To stop it from opening the doc's properties, it needs to be formatted using the following JSON:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
"elmType": "a",
"txtContent": "@currentField",
"attributes": {
"target": "_blank",
"href": "=@currentField"
}
}I then used a look-up column to pull this link to a data list, and formatted it with the same code.
Let me know if you need anything else.
- SarastorJun 23, 2022Copper Contributor
Hi there!
Thanks for the insctructions with JSON formatting. This helped me a lot and I am now able to click on the name of the file in my Sharepoint List which then opens the document from my library.
My question concerns a step more. I want to lookup multiple files from my library. When I only use one file to lookup it works but when I choose multiple files they appear in just one link and I can not click them one by one.
It looks like this and leads me to a blank Sharepoint Site.Is there a way to apply JSON formatting once again to separate the links for each row?
Another problem occurs when I manually add the file which I want to lookup:
I select the row which I want to edit, then I select "open the details pane", then I scroll down to my Lookup JSON column and click it to add my file which I want to lookup. When I do this, it automatically opens a new Tab which leads me to my library. Is it possible that this does not happen and I can add my lookup file without opening a new Tab?Thank you very much!