Back to form formats
Form formattingSharePoint Online

Two Column Logo Header

This sample displays an Icon and Title in a two column header with the Icon on the left and the Title on the right. An additional Icon and RequestStatus and added below the Title.

screenshot of the sample
Sample preview · View original image

Copy. Apply. Make it yours.

Get this format

1 definition

Review the requirements below, then paste this JSON into the matching formatting panel. Show me where.

Use your list's internal column names and replace any tenant-specific URLs or flow IDs. Formatting is presentation, not a way to secure data.

Form header
Download JSON
{
  "elmType": "div",
  "attributes": {
    "class": "=if([$RequestStatus] == 'Approved', 'ms-bgColor-teal', if([$RequestStatus] == 'Pending', 'ms-bgColor-gray130', if([$RequestStatus] == 'Rejected', 'ms-bgColor-redDark', if([$RequestStatus] == 'Withdrawn', 'ms-bgColor-yellow','ms-bgColor-gray130'))))"
  },
  "style": {
    "width": "99%",
    "border-top-width": "0px",
    "border-bottom-width": "1px",
    "border-left-width": "0px",
    "border-right-width": "0px",
    "border-style": "solid",
    "margin-bottom": "16px"
  },
  "children": [
    {
      "elmType": "div",
      "style": {
        "display": "flex",
        "box-sizing": "border-box",
        "align-items": "center"
      },
      "children": [
        {
          "elmType": "div",
          "attributes": {
            "iconName": "CRMCustomerInsightsApp",
            "class": "ms-fontSize-42 ms-fontWeight-regular ms-fontColor-white",
            "title": "Details"
          },
          "style": {
            "flex": "none",
            "padding-left": "15px",
            "padding-right": "15px",
            "height": "36px"
          }
        }
      ]
    },
    {
      "elmType": "div",
      "attributes": {
        "class": "ms-fontColor-white ms-fontWeight-bold ms-fontSize-24"
      },
      "style": {
        "box-sizing": "border-box",
        "width": "100%",
        "text-align": "left",
        "padding": "21px 12px",
        "overflow": "hidden"
      },
      "children": [
        {
          "elmType": "div",
          "style": {
            "width": "100%",
            "display": "flex",
            "flex-direction": "column",
            "align-items": "left"
          },
          "children": [
            {
              "elmType": "div",
              "attributes": {
                "class": "ms-fontSize-24"
              },
              "txtContent": "='Sample Title: ' + [$Title]",
              "style": {
                "margin-top": "5px"
              }
            },
            {
              "elmType": "div",
              "children": [
                {
                  "elmType": "span",
                  "attributes": {
                    "class": "ms-fontSize-16 ms-fontColor-white",
                    "iconName": "=if([$RequestStatus] == 'Approved', 'SkypeCircleCheck', if([$RequestStatus] == 'Pending', 'ProgressRingDots', if([$RequestStatus] == 'Rejected', 'StatusErrorFull', if([$RequestStatus] == 'Withdrawn', 'IncidentTriangle','ProgressRingDots'))))"
                  }
                },
                {
                  "elmType": "span",
                  "attributes": {
                    "class": "ms-fontSize-16"
                  },
                  "style": {
                    "padding-right": "8px",
                    "padding-left": "8px"
                  },
                  "txtContent": "='Request Status: ' + [$RequestStatus]"
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}

From the contributor

How to use this sample

Summary

This sample displays an Icon and Title in a two column header with the Icon on the left and the Title on the right. An additional Icon and RequestStatus and added below the Title.

screenshot of the sample

Form requirements

Type Internal Name Required
Single line of text Title Yes
Choice RequestStatus Yes

RequestStatus Choices

Value
Approved
Pending
Rejected
Withdrawn

Based on the value of RequestStatus value, the color of the column is changed along with the icon.

  • RequestStatus: Default (not chosen)

    screenshot of the sample when RequestStatus is blank

  • RequestStatus: Approved

    screenshot of the sample when RequestStatus is Approved

  • RequestStatus: Pending

    screenshot of the sample when RequestStatus is Pending

  • RequestStatus: Rejected

    screenshot of the sample when RequestStatus is Rejected

  • RequestStatus: Withdrawn

    screenshot of the sample when RequestStatus is Withdrawn

This sample logo uses the CRMCustomerInsightsApp from Fluent UI Icons.

Sample

Solution Author(s)
two-column-logo-header.json Andrew Burns

Version history

Version Date Comments
1.0 July 14, 2024 Initial release

Disclaimer

THIS CODE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.