Hi,
As EchoDu mentioned, it is not possible out of the box as by design lookup column links to display form of the item being looked up, in your case the document display form.
However there is a way to get past this and achieve the functionality using Json Column formatting.
- Set up the document library Title/Any other custom text column data with the document name with extension. example- the value should be something like "ABC Documents.pdf"
- In the list where you use lookup, look up to this column -
- Use JSON fomatting on the lookup column,
HOW TO REFERENCE
- Verify the functionality
Here is some json code I was trying out in my environment,
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "a",
"txtContent": "@currentField.lookupValue",
"attributes": {
"target": "_blank",
"href": "='https://abctenant.sharepoint.com/sites/Demo/Shared%20Documents/' + @currentField.lookupValue"
}
}
@currentField.lookupValue will get the text value from lookup library.