Forum Discussion

Ant__thony's avatar
Ant__thony
Copper Contributor
Mar 07, 2023

SPO List JSON Formatting - Dynamic Hyperlinks with column if statements

I'm attempting to change the hyperlink depending on a choice column "RequestType".  Have been unable to set the url while also adding in a column data. Here is what I have tried.     First Test ...
  • ganeshsanap's avatar
    Mar 07, 2023

    Ant__thony Use JSON formatting in this format: 

     

    {
      "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
      "elmType": "a",
      "txtContent": "Net Link",
      "attributes": {
        "href": "=if([$RequestType] == 'Create', 'https://removelink.=' + [$TicketNumber], if([$RequestType] == 'Move', 'https://link/ticketid=' + [$TicketNumber], 'https://www.google.com/'))",
        "target": "_blank"
      }
    }

     

    Output


    Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

    For SharePoint/Power Platform blogs, visit: Ganesh Sanap Blogs

Resources