JSON Sharepoint list / advanced mode: How to combine two different formulations?

Lukas 21 Reputation points
2022-05-02T06:50:07.853+00:00

Hello,
i urgently need your help. I made a list on Sharepoint and would like to adjust them at certain points. I have 2 different formats. In one format, a dividing line should be drawn after each line. In the second format, the entire line should have a gray background for a certain status. In fact, both work. But I want both formats to work for one list. How do I have to formulate JSON so that both work for one list?

  1. formulation:
    {
    "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json",
    "additionalRowClass": "sp-field-fontSizeSmall sp-field-borderTopBottomSemibold sp-field-borderTopBottomSolid sp-css-borderTopColor-neutralPrimary sp-css-borderBottomColor-neutralPrimary"
    }

2.formulation:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json",
"additionalRowClass": {
"operator": ":",
"operands": [
{
"operator": "==",
"operands": [
"[$Status]",
"Inaktiv"
]
},
"sp-css-backgroundColor-BgLightGray sp-css-color-LightGrayFont",
""
]
}
}

I hope someone can help me.
Kind regards
Lukas

SharePoint Server
SharePoint Server
A family of Microsoft on-premises document management and storage systems.
2,291 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,211 questions
{count} votes

Accepted answer
  1. Emily Du-MSFT 43,831 Reputation points Microsoft Vendor
    2022-05-03T03:01:24.733+00:00

    @Lukas

    Please try below JSON codes.

    {  
    "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json",  
    "additionalRowClass": {  
    "operator": ":",  
    "operands": [  
    {  
    "operator": "==",  
    "operands": [  
    "[$Status]",  
    "Inaktiv"  
    ]  
    },  
    "sp-css-backgroundColor-BgLightGray sp-css-color-LightGrayFont sp-field-fontSizeSmall sp-field-borderTopBottomSemibold sp-field-borderTopBottomSolid sp-css-borderTopColor-neutralPrimary sp-css-borderBottomColor-neutralPrimary",  
    "sp-field-fontSizeSmall sp-field-borderTopBottomSemibold sp-field-borderTopBottomSolid sp-css-borderTopColor-neutralPrimary sp-css-borderBottomColor-neutralPrimary"  
    ]  
    }  
    }  
    

    Result:

    198432-image.png


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful