Forum Discussion
Displaying DocLib File URL Path in Column
- Jul 18, 2023
Hi KevBel,
you could apply the following json formatting to your "Path" column{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "div", "txtContent": "=[$FileRef]" }
You will get a view like thisIf you don't want the path to your document library to be displayed ("/sites/MyAppPage/CopyLib/" in my example), then use this json
{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "div", "txtContent": "=replace([$FileRef],'/sites/MyAppPage/CopyLib/','')" }
This will look like this
Best Regards,
Sven
Hi KevBel,
you could apply the following json formatting to your "Path" column
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"txtContent": "=[$FileRef]"
}
You will get a view like this
If you don't want the path to your document library to be displayed ("/sites/MyAppPage/CopyLib/" in my example), then use this json
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"txtContent": "=replace([$FileRef],'/sites/MyAppPage/CopyLib/','')"
}
This will look like this
Best Regards,
Sven
Hi Sven this works for me, but I would like to export the data, and push the url into another system. when I export it the field is blank, I have read that I need a calculated field to export it, any ideas on how you get the same output with a calculated field?
EDIT: NVM I was Able to solve this via Power Automate, thank you on getting me on the right path