Forum Discussion
grant_jenkins
Aug 10, 2024Steel Contributor
List Form Formatting - can't get title and hyperlink from Hyperlink column
I have a Hyperlink column and trying to display it within the footer of the List Form using JSON formatting. However, I can't seem to split the Title and URL of the Hyperlink value. If I just try...
- Aug 11, 2024
Hi grant_jenkins, You are right; the Hyperlink column value behaves differently in column formatting compared to form formatting.
Fortunately, you can use the following function to retrieve Hyperlink column information in form (header or footer) formatting:
- Url
"txtContent": "=substring('[$FieldName]',0,indexOf('[$FieldName]', ','))"and title
"txtContent": "=substring('[$FieldName]',indexOf('[$LinkTest]', ',')+2,indexOf([$FieldName] + '^', '^'))"
LauraDaisy
Sep 26, 2024Copper Contributor
Thankyou, this is the code I use on the row formatting.
"elmType": "a",
"attributes": {
"href": "[$Link.url]",
"target": "_blank"
},
"txtContent": "[$Link.desc]"
"elmType": "a",
"attributes": {
"href": "[$Link.url]",
"target": "_blank"
},
"txtContent": "[$Link.desc]"
michalkornet
Sep 27, 2024Steel Contributor
Hi LauraDaisy, I checked again today, and it looks like the column formatting has started working. However, the issue with the view formatting remains the same.
You can try this sample on your environment (in my case I get empty value when I use hyperlink column) https://github.com/pnp/List-Formatting/tree/master/view-samples/menu-link-tiles
- LauraDaisySep 30, 2024Copper ContributorHi michalkornet
i'm not entirely sure what I need to do. Do I need to add column formatting AND row formatting?- michalkornetOct 02, 2024Steel Contributor
Hi LauraDaisy, in the last post, I meant that the column formatting works, but unfortunately, it is not working in view formatting.