Forum Discussion
jacobite
Sep 05, 2022Copper Contributor
automatic numbering in lists
Hi - relative newbie. Not only that, but relative newbie creating a risk register using a list ๐ Can someone tell me how a can configure a list in SP online so that each new item is automatically...
RobElliott
Sep 06, 2022Silver Contributor
jacobite and it's easy enough in a SharePoint list as well with JSON column formatting. In this example Probability is a number column with decimal points set to 0, so is Impact. RiskScore is a calculated column with the formula =[Probability]*[Impact]. Then click the dropdown next to RiskScore, select Column settings and then select Format this column. Select Advanced mode, clear everything and paste in the following JSON:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"txtContent": "@currentField",
"style": {
"background-color": "=if(@currentField >= 15, 'red', if(@currentField >=10 &&@currentField<15, 'gold','green')",
"color": "=if(@currentField >= 15, 'white', if(@currentField >=10 && @currentField<15, 'black','white')",
"padding-left": "4px"
}
}
That will result in this:
Of course you can change the parameters, colors or add more if you need to.
Rob
Los Gallardos
Intranet, SharePoint and Power Platform Manager (and classic 1967 Morris Traveller driver)
jacobite
Sep 07, 2022Copper Contributor
RobElliott sincere thanks for such a detailed and helpful response. Much appreciated.