question

CashionColby-4824 avatar image
0 Votes"
CashionColby-4824 asked ·

JSON column formatting not recognizing column reference

Hello,

I am trying to add a custom hyperlink to a Sharepoint list column, that changes the URL based on another value in the column. Currently my formatting is the following

{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json";,
"elmType": "a",
"txtContent": "View Evidence",
"attributes": {
"target": "_blank",
"href": "='https://intelsat.sharepoint.com/sites/SOC3Audit/2021 SOC 3 Audit document repo/' + [$RequestNum]"
}

}

Currently, in the href, the RequestNum column is not getting picked up, and the link always directs to the URL without the column included at the end. I've tried to add a column name to dynamically appear in the txt Content as well, but the link just appears in the list as "View Evidence for [$RequestNum]".

I have tried a variety of different formats for the column name but none have worked so far. Is there anything in SP Online that needs to be enabled for this to work? This is a Modern list.

Thanks,
Colby

office-sharepoint-online
· 1
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@CashionColby-4824

I'm checking how the things are going on about this issue. Whether the answer helps you?

You can accept the answer if it helps.


If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 Votes 0 ·

1 Answer

EmilyDu-MSFT avatar image
0 Votes"
EmilyDu-MSFT answered ·

@CashionColby-4824
Based on your description, I understand that you create a Hyperlink column and a RequestNum column. You want to the value in the Hyperlink column becomes a hyperlink according to the RequestNum column.

Here’re steps:

1.Create a text column named Hyperlink.
2. Create a text column named RequestNum。
3.Use following Json formatting in the Hyperlink column.

 {
 "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
 "elmType": "a",
 "txtContent": "View Evidence",
 "attributes": {
 "target": "_blank",
 "href": "='https://intelsat.sharepoint.com/sites/SOC3Audit/2021 SOC 3 Audit document repo/' + [$RequestNum]"
    }
 }

If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.





· Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.