I have two SharePoint lists:
List 1 - has item details
List 2 - has shipping details
As one item can be shipped to different locations, List 1 has one to many relationship with List 2.
List 2 has tracking number and courier columns. I linked those to List 1 as multi-value lookup column, tracking numbers as main value and courier as additional field.
Is there a way to create hyperlinks on the tracking numbers in List 1 to link to the respective courier's page for actually seeing the tracking info. So depending on the value of the courier, the tracking web address should change.
I don't even know if individual hyperlinks can be added to multi-value lookup columns even to a single web address. So I tried that below (which doesn't work and doesn't consider lookup additional field value) but I have no idea if that is possible.
If possible I need the address to be changing depending on lookup additional field value. If UPS, link to UPS page, if DHL, then DHL page, etc..
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"debugMode": true,
"elmType": "div",
"children": [
{
"elmType": "div",
"style": {
"display": "block",
"width": "100%"
},
"txtContent": "=join(@currentField.lookupValue, '\n')",
"attributes": {
"target": "_blank",
"href": "='http://wwwapps.ups.com/WebTracking/track?track=yes&trackNums=' + @currentField.lookupValue"
}
}
]
}