1

I'm trying to inject some life into an old Sharepoint site (classic) by creating a new Progress Bar based on a %Complete field.

The new JSON template code provided by Microsoft doesnt seem to want to work on a Classic site, so any help with getting it or something similar to work is greatly appreciated.

I'm applying it to my field %Complete which is just a number field (it's populate via a workflow)

Current Code:

{
   "elmType":"div",
   "children":[
      {
         "elmType":"span",
         "txtContent":{
            "operator":"+",
            "operands":[
               {
                  "operator":"*",
                  "operands":[
                     "@currentField",
                     100
                  ]
               },
               " %"
            ]
         },
         "style":{
            "background-color":{
               "operator":"?",
               "operands":[
                  {
                     "operator":"<=",
                     "operands":[
                        "@currentField",
                        0.33
                     ]
                  },
                  "#ffa500",
                  {
                     "operator":"?",
                     "operands":[
                        {
                           "operator":"<=",
                           "operands":[
                              "@currentField",
                              0.66
                           ]
                        },
                        "#ffff00",
                        "#00ff00"
                     ]
                  }
               ]
            },
            "width":{
               "operator":"+",
               "operands":[
                  {
                     "operator":"*",
                     "operands":[
                        "@currentField",
                        100
                     ]
                  },
                  "%"
               ]
            },
            "text-align":"center"
         }
      }
   ]
}

1 Answer 1

1

As I understand it, using JSON for column formating only works on Modern sites. I spent a long time trying to get progress bars on Classic sites working with CSR and gave up. I'm sure someone who knows more will be along in a bit. Meantime here is a link to some more info on trying to make it work.

4
  • Thanks Hydrogen, yeah the issue is definitely the classic template, it's a pain. I've now moved on and i'm currently using one of my 3rd party apps to build the progress bars.
    – cod3r_jim
    Feb 26, 2018 at 9:33
  • Great to hear. Would love to know if you get it working as I would like to as well. :-)
    – Hydrogen
    Feb 26, 2018 at 10:10
  • I spent way too much time trying to replicate various solutions and they all have trouble working or just dont work using the classic template. Instead i'm using InfoWise Ultimate Forms, it has a built in Progress Bar feature.
    – cod3r_jim
    Feb 27, 2018 at 9:09
  • Now that's a helpful tip. I'll investigate that. thanks
    – Hydrogen
    Feb 28, 2018 at 9: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.