SharePoint Hyperlink Conditional Formatting based on another Field Value
In SharePoint Online, you can easily use JSON conditional formatting to show different links based on another field value selection by using Nested-IF as below
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
"elmType": "a",
"txtContent": "@currentField",
"attributes": {
"target": "_blank",
"href": "=if([$Carrier]='Purolator','https://www.purolator.com/en/shipping/tracker?pins=' + @currentField, if([$Carrier]='Fedex','https://www.fedex.com/fedextrack/?trknbr=' + @currentField, 'https://debug.to'))"
}
}
The above JSON formatting should be working fine for different hyperlinks based on another field value selection and you can add multiple IF conditions based on your requirements.
See also