SharePoint List View Formatting @currentWeb Token not being replaced

%3CLINGO-SUB%20id%3D%22lingo-sub-1118137%22%20slang%3D%22en-US%22%3ESharePoint%20List%20View%20Formatting%20%40currentWeb%20Token%20not%20being%20replaced%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1118137%22%20slang%3D%22en-US%22%3E%3CP%3EStarted%20seeing%20today%20that%20the%26nbsp%3B%40currentWeb%20token%20is%20not%20being%20replaced%20in%20a%20custom%20list%20view%20format.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EURLs%20created%20with%20the%20token%20just%20contain%20the%20literal%20string%22%40currentWeb%22%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CEM%3Ee.g.%20the%20snippet%20below%20results%20in%20a%20link%20with%20the%20URL%3B%3C%2FEM%3E%3C%2FP%3E%3CP%3E%3CEM%3E%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%3CA%20href%3D%22https%3A%2F%2Ftenant.sharepoint.com%2Fsites%2Fcontoso%2FLists%2FMyCustomList%2F%40currentWeb%2FLists%2FMyCustomList%2FDispForm.aspx%3FID%3D10%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2Ftenant.sharepoint.com%2Fsites%2Fcontoso%2FLists%2FMyCustomList%2F%40currentWeb%2FLists%2FMyCustomList%2FDispForm.aspx%3FID%3D10%3C%2FA%3E%3C%2FFONT%3E%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-javascript%22%3E%3CCODE%3E%7B%0A%20%20%20%22elmType%22%3A%20%22a%22%2C%0A%20%20%20%22attributes%22%3A%20%7B%0A%20%20%20%20%20%20%22class%22%3A%20%22ms-fontSize-xxl%20ms-fontColor-themePrimary%22%2C%0A%20%20%20%20%20%20%22href%22%3A%20%22%3D%40currentWeb%20%2B%20'%2FLists%2FMyCustomList%2FDispForm.aspx%3FID%3D'%20%2B%20'%5B%24ID%5D'%22%0A%20%20%20%7D%2C%0A%20%20%20%22txtContent%22%3A%20%22%5B%24Title%5D%22%0A%7D%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1118137%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ELists%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Senior Member

Started seeing today that the @currentWeb token is not being replaced in a custom list view format.

 

URLs created with the token just contain the literal string"@currentWeb"

 

e.g. the snippet below results in a link with the URL;

https://tenant.sharepoint.com/sites/contoso/Lists/MyCustomList/@currentWeb/Lists/MyCustomList/DispFo...

 

 

{
   "elmType": "a",
   "attributes": {
      "class": "ms-fontSize-xxl ms-fontColor-themePrimary",
      "href": "=@currentWeb + '/Lists/MyCustomList/DispForm.aspx?ID=' + '[$ID]'"
   },
   "txtContent": "[$Title]"
}

 

 

 

0 Replies