1

I am trying to use Microsoft's Sharepoint List Dev document to do a "Turn field values into hyperlinks (basic). My code looks like this:

{
   "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
   "elmType": "a",
   "txtContent": "@currentField",
   "attributes": {
      "target": "_blank",
      "href": "='http://finance.yahoo.com/quote/' + @currentField"
   }
}

My problem is that i need my @currentfield is in the middle of the URL and i dont know the proper "JSON Grammar" to make that happen.

Example URL: https://dontknowwhatiamdoing.com/something/something/"insert @currentfield here/something

I have made this code work but only when the @currentField is at the end of the URL.

Please help...i know i am a Noob at this.

0

You're nearly there! You can add more than one thing in an expression, so you can change your format to something like this:

{
   "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
   "elmType": "a",
   "txtContent": "@currentField",
   "attributes": {
      "target": "_blank",
      "href": "='https://dontknowwhatiamdoing.com/something/' + @currentField + '/something'"
   }
}
1
  • 1
    theChrisKent Thank you so Much....worked perfectly!!! – user95233 Mar 5 at 15:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.