Forum Discussion
Document Lookup Column Link
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.
Thanks! Great workaround. I have the link working, but are you able to display the name of the file instead of the url? If so, I need a pointer in how to fill in that missing piece.
- Alen666Nov 13, 2020Copper Contributor
I had a second lookup column that was coded with JSON to show a button as the link:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "button",
"txtContent": "Open",
"customRowAction": {
"action": "defaultClick"
}
}Unfortunately, my internal customer has discovered that they no longer get links 😞
I am assuming that there has been an Evergreen update that has broken the functionality?
I found this thread in my research to find a new solution.
- Phil_COBSep 11, 2019Copper Contributor
It wasn't part of the scope of the project, so no. I'll experiment and if I find anything I'll let you know.