Back to view formats
View formattingSharePoint Online

Emoji Reactions

This sample demonstrates reacting with an emoji. Who reacted and the total counts per reaction are stored with the list item.

Emoji Reactions formatting preview
Sample preview Β· View original image

Copy. Apply. Make it yours.

Get this format

2 definitions

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.

View formatting
Download JSON
{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json",
  "hideColumnHeader": true,
  "hideSelection": true,
  "rowFormatter": {
    "elmType": "div",
    "style": {
      "padding": "10px"
    },
    "children": [
      {
        "elmType": "div",
        "style": {
          "display": "inline-block"
        },
        "children": [
          {
            "elmType": "div",
            "style": {
              "border": "3px solid #ccc",
              "border-radius": "50%",
              "padding": "10px",
              "cursor": "pointer"
            },
            "attributes": {
              "iconName": "Add",
              "class": "ms-fontSize-24 ms-fontColor-blueDark ms-bgColor-communicationTint40 ms-bgColor-communicationTint20--hover"
            },
            "customCardProps": {
              "openOnEvent": "click",
              "directionalHint": "topCenter",
              "isBeakVisible": true,
              "formatter": {
                "elmType": "div",
                "style": {
                  "padding": "10px"
                },
                "children": [
                  {
                    "elmType": "div",
                    "style": {
                      "padding": "5px",
                      "border-radius": "5px",
                      "cursor": "pointer"
                    },
                    "attributes": {
                      "class": "ms-bgColor-gray30--hover ms-fontSize-20"
                    },
                    "txtContent": "πŸ™‚",
                    "customRowAction": {
                      "action": "setValue",
                      "actionInput": {
                        "Emotion": "=if(indexOf([$Emotion],'πŸ™‚'+@me) > -1, replace([$Emotion],'πŸ™‚'+@me,''), [$Emotion]+'πŸ™‚'+@me)",
                        "EmotionCount": "=if(length([$EmotionCount])==0,'πŸ™‚1πŸ™0πŸ˜ƒ0πŸ‘0πŸ‘‹0πŸ””0πŸ‘‘0πŸ”Ž0β˜•0|',if(indexOf([$Emotion],'πŸ™‚'+@me) > -1, substring([$EmotionCount],0,indexOf([$EmotionCount],'πŸ™‚')+2)+toString((Number(substring([$EmotionCount],indexOf([$EmotionCount],'πŸ™‚')+2,lastIndexOf([$EmotionCount],'πŸ™'))))-1)+substring([$EmotionCount],lastIndexOf([$EmotionCount],'πŸ™'),indexOf([$EmotionCount]+'.','.')), substring([$EmotionCount],0,indexOf([$EmotionCount],'πŸ™‚')+2)+toString((Number(substring([$EmotionCount],indexOf([$EmotionCount],'πŸ™‚')+2,lastIndexOf([$EmotionCount],'πŸ™'))))+1)+substring([$EmotionCount],lastIndexOf([$EmotionCount],'πŸ™'),indexOf([$EmotionCount]+'.','.'))))"
                      }
                    }
                  },
                  {
                    "elmType": "div",
                    "style": {
                      "padding": "5px",
                      "border-radius": "5px",
                      "cursor": "pointer"
                    },
                    "attributes": {
                      "class": "ms-bgColor-gray30--hover ms-fontSize-20"
                    },
                    "txtContent": "πŸ™",
                    "customRowAction": {
                      "action": "setValue",
                      "actionInput": {
                        "Emotion": "=if(indexOf([$Emotion],'πŸ™'+@me) > -1, replace([$Emotion],'πŸ™'+@me,''), [$Emotion]+'πŸ™'+@me)",
                        "EmotionCount": "=if(length([$EmotionCount])==0,'πŸ™‚0πŸ™1πŸ˜ƒ0πŸ‘0πŸ‘‹0πŸ””0πŸ‘‘0πŸ”Ž0β˜•0|',if(indexOf([$Emotion],'πŸ™'+@me) > -1, substring([$EmotionCount],0,indexOf([$EmotionCount],'πŸ™')+2)+toString((Number(substring([$EmotionCount],indexOf([$EmotionCount],'πŸ™')+2,lastIndexOf([$EmotionCount],'πŸ˜ƒ'))))-1)+substring([$EmotionCount],lastIndexOf([$EmotionCount],'πŸ˜ƒ'),indexOf([$EmotionCount]+'.','.')), substring([$EmotionCount],0,indexOf([$EmotionCount],'πŸ™')+2)+toString((Number(substring([$EmotionCount],indexOf([$EmotionCount],'πŸ™')+2,lastIndexOf([$EmotionCount],'πŸ˜ƒ'))))+1)+substring([$EmotionCount],lastIndexOf([$EmotionCount],'πŸ˜ƒ'),indexOf([$EmotionCount]+'.','.'))))"
                      }
                    }
                  },
                  {
                    "elmType": "div",
                    "style": {
                      "padding": "5px",
                      "border-radius": "5px",
                      "cursor": "pointer"
                    },
                    "attributes": {
                      "class": "ms-bgColor-gray30--hover ms-fontSize-20"
                    },
                    "txtContent": "πŸ˜ƒ",
                    "customRowAction": {
                      "action": "setValue",
                      "actionInput": {
                        "Emotion": "=if(indexOf([$Emotion],'πŸ˜ƒ'+@me) > -1, replace([$Emotion],'πŸ˜ƒ'+@me,''), [$Emotion]+'πŸ˜ƒ'+@me)",
                        "EmotionCount": "=if(length([$EmotionCount])==0,'πŸ™‚0πŸ™0πŸ˜ƒ1πŸ‘0πŸ‘‹0πŸ””0πŸ‘‘0πŸ”Ž0β˜•0|',if(indexOf([$Emotion],'πŸ˜ƒ'+@me) > -1, substring([$EmotionCount],0,indexOf([$EmotionCount],'πŸ˜ƒ')+2)+toString((Number(substring([$EmotionCount],indexOf([$EmotionCount],'πŸ˜ƒ')+2,lastIndexOf([$EmotionCount],'πŸ‘'))))-1)+substring([$EmotionCount],lastIndexOf([$EmotionCount],'πŸ‘'),indexOf([$EmotionCount]+'.','.')), substring([$EmotionCount],0,indexOf([$EmotionCount],'πŸ˜ƒ')+2)+toString((Number(substring([$EmotionCount],indexOf([$EmotionCount],'πŸ˜ƒ')+2,lastIndexOf([$EmotionCount],'πŸ‘'))))+1)+substring([$EmotionCount],lastIndexOf([$EmotionCount],'πŸ‘'),indexOf([$EmotionCount]+'.','.'))))"
                      }
                    }
                  },
                  {
                    "elmType": "div",
                    "style": {
                      "padding": "5px",
                      "border-radius": "5px",
                      "cursor": "pointer"
                    },
                    "attributes": {
                      "class": "ms-bgColor-gray30--hover ms-fontSize-20"
                    },
                    "txtContent": "πŸ‘",
                    "customRowAction": {
                      "action": "setValue",
                      "actionInput": {
                        "Emotion": "=if(indexOf([$Emotion],'πŸ‘'+@me) > -1, replace([$Emotion],'πŸ‘'+@me,''), [$Emotion]+'πŸ‘'+@me)",
                        "EmotionCount": "=if(length([$EmotionCount])==0,'πŸ™‚0πŸ™0πŸ˜ƒ0πŸ‘1πŸ‘‹0πŸ””0πŸ‘‘0πŸ”Ž0β˜•0|',if(indexOf([$Emotion],'πŸ‘'+@me) > -1, substring([$EmotionCount],0,indexOf([$EmotionCount],'πŸ‘')+2)+toString((Number(substring([$EmotionCount],indexOf([$EmotionCount],'πŸ‘')+2,lastIndexOf([$EmotionCount],'πŸ‘‹'))))-1)+substring([$EmotionCount],lastIndexOf([$EmotionCount],'πŸ‘‹'),indexOf([$EmotionCount]+'.','.')), substring([$EmotionCount],0,indexOf([$EmotionCount],'πŸ‘')+2)+toString((Number(substring([$EmotionCount],indexOf([$EmotionCount],'πŸ‘')+2,lastIndexOf([$EmotionCount],'πŸ‘‹'))))+1)+substring([$EmotionCount],lastIndexOf([$EmotionCount],'πŸ‘‹'),indexOf([$EmotionCount]+'.','.'))))"
                      }
                    }
                  },
                  {
                    "elmType": "div",
                    "style": {
                      "padding": "5px",
                      "border-radius": "5px",
                      "cursor": "pointer"
                    },
                    "attributes": {
                      "class": "ms-bgColor-gray30--hover ms-fontSize-20"
                    },
                    "txtContent": "πŸ‘‹",
                    "customRowAction": {
                      "action": "setValue",
                      "actionInput": {
                        "Emotion": "=if(indexOf([$Emotion],'πŸ‘‹'+@me) > -1, replace([$Emotion],'πŸ‘‹'+@me,''), [$Emotion]+'πŸ‘‹'+@me)",
                        "EmotionCount": "=if(length([$EmotionCount])==0,'πŸ™‚0πŸ™0πŸ˜ƒ0πŸ‘0πŸ‘‹1πŸ””0πŸ‘‘0πŸ”Ž0β˜•0|',if(indexOf([$Emotion],'πŸ‘‹'+@me) > -1, substring([$EmotionCount],0,indexOf([$EmotionCount],'πŸ‘‹')+2)+toString((Number(substring([$EmotionCount],indexOf([$EmotionCount],'πŸ‘‹')+2,lastIndexOf([$EmotionCount],'πŸ””'))))-1)+substring([$EmotionCount],lastIndexOf([$EmotionCount],'πŸ””'),indexOf([$EmotionCount]+'.','.')), substring([$EmotionCount],0,indexOf([$EmotionCount],'πŸ‘‹')+2)+toString((Number(substring([$EmotionCount],indexOf([$EmotionCount],'πŸ‘‹')+2,lastIndexOf([$EmotionCount],'πŸ””'))))+1)+substring([$EmotionCount],lastIndexOf([$EmotionCount],'πŸ””'),indexOf([$EmotionCount]+'.','.'))))"
                      }
                    }
                  },
                  {
                    "elmType": "div",
                    "style": {
                      "padding": "5px",
                      "border-radius": "5px",
                      "cursor": "pointer"
                    },
                    "attributes": {
                      "class": "ms-bgColor-gray30--hover ms-fontSize-20"
                    },
                    "txtContent": "πŸ””",
                    "customRowAction": {
                      "action": "setValue",
                      "actionInput": {
                        "Emotion": "=if(indexOf([$Emotion],'πŸ””'+@me) > -1, replace([$Emotion],'πŸ””'+@me,''), [$Emotion]+'πŸ””'+@me)",
                        "EmotionCount": "=if(length([$EmotionCount])==0,'πŸ™‚0πŸ™0πŸ˜ƒ0πŸ‘0πŸ‘‹0πŸ””1πŸ‘‘0πŸ”Ž0β˜•0|',if(indexOf([$Emotion],'πŸ””'+@me) > -1, substring([$EmotionCount],0,indexOf([$EmotionCount],'πŸ””')+2)+toString((Number(substring([$EmotionCount],indexOf([$EmotionCount],'πŸ””')+2,lastIndexOf([$EmotionCount],'πŸ‘‘'))))-1)+substring([$EmotionCount],lastIndexOf([$EmotionCount],'πŸ‘‘'),indexOf([$EmotionCount]+'.','.')), substring([$EmotionCount],0,indexOf([$EmotionCount],'πŸ””')+2)+toString((Number(substring([$EmotionCount],indexOf([$EmotionCount],'πŸ””')+2,lastIndexOf([$EmotionCount],'πŸ‘‘'))))+1)+substring([$EmotionCount],lastIndexOf([$EmotionCount],'πŸ‘‘'),indexOf([$EmotionCount]+'.','.'))))"
                      }
                    }
                  },
                  {
                    "elmType": "div",
                    "style": {
                      "padding": "5px",
                      "border-radius": "5px",
                      "cursor": "pointer"
                    },
                    "attributes": {
                      "class": "ms-bgColor-gray30--hover ms-fontSize-20"
                    },
                    "txtContent": "πŸ‘‘",
                    "customRowAction": {
                      "action": "setValue",
                      "actionInput": {
                        "Emotion": "=if(indexOf([$Emotion],'πŸ‘‘'+@me) > -1, replace([$Emotion],'πŸ‘‘'+@me,''), [$Emotion]+'πŸ‘‘'+@me)",
                        "EmotionCount": "=if(length([$EmotionCount])==0,'πŸ™‚0πŸ™0πŸ˜ƒ0πŸ‘0πŸ‘‹0πŸ””0πŸ‘‘1πŸ”Ž0β˜•0|',if(indexOf([$Emotion],'πŸ‘‘'+@me) > -1, substring([$EmotionCount],0,indexOf([$EmotionCount],'πŸ‘‘')+2)+toString((Number(substring([$EmotionCount],indexOf([$EmotionCount],'πŸ‘‘')+2,lastIndexOf([$EmotionCount],'πŸ”Ž'))))-1)+substring([$EmotionCount],lastIndexOf([$EmotionCount],'πŸ”Ž'),indexOf([$EmotionCount]+'.','.')), substring([$EmotionCount],0,indexOf([$EmotionCount],'πŸ‘‘')+2)+toString((Number(substring([$EmotionCount],indexOf([$EmotionCount],'πŸ‘‘')+2,lastIndexOf([$EmotionCount],'πŸ”Ž'))))+1)+substring([$EmotionCount],lastIndexOf([$EmotionCount],'πŸ”Ž'),indexOf([$EmotionCount]+'.','.'))))"
                      }
                    }
                  },
                  {
                    "elmType": "div",
                    "style": {
                      "padding": "5px",
                      "border-radius": "5px",
                      "cursor": "pointer"
                    },
                    "attributes": {
                      "class": "ms-bgColor-gray30--hover ms-fontSize-20"
                    },
                    "txtContent": "πŸ”Ž",
                    "customRowAction": {
                      "action": "setValue",
                      "actionInput": {
                        "Emotion": "=if(indexOf([$Emotion],'πŸ”Ž'+@me) > -1, replace([$Emotion],'πŸ”Ž'+@me,''), [$Emotion]+'πŸ”Ž'+@me)",
                        "EmotionCount": "=if(length([$EmotionCount])==0,'πŸ™‚0πŸ™0πŸ˜ƒ0πŸ‘0πŸ‘‹0πŸ””0πŸ‘‘0πŸ”Ž1β˜•0|',if(indexOf([$Emotion],'πŸ”Ž'+@me) > -1, substring([$EmotionCount],0,indexOf([$EmotionCount],'πŸ”Ž')+2)+toString((Number(substring([$EmotionCount],indexOf([$EmotionCount],'πŸ”Ž')+2,lastIndexOf([$EmotionCount],'β˜•'))))-1)+substring([$EmotionCount],lastIndexOf([$EmotionCount],'β˜•'),indexOf([$EmotionCount]+'.','.')), substring([$EmotionCount],0,indexOf([$EmotionCount],'πŸ”Ž')+2)+toString((Number(substring([$EmotionCount],indexOf([$EmotionCount],'πŸ”Ž')+2,lastIndexOf([$EmotionCount],'β˜•'))))+1)+substring([$EmotionCount],lastIndexOf([$EmotionCount],'β˜•'),indexOf([$EmotionCount]+'.','.'))))"
                      }
                    }
                  },
                  {
                    "elmType": "div",
                    "style": {
                      "padding": "5px",
                      "border-radius": "5px",
                      "cursor": "pointer"
                    },
                    "attributes": {
                      "class": "ms-bgColor-gray30--hover ms-fontSize-20"
                    },
                    "txtContent": "β˜•",
                    "customRowAction": {
                      "action": "setValue",
                      "actionInput": {
                        "Emotion": "=if(indexOf([$Emotion],'β˜•'+@me) > -1, replace([$Emotion],'β˜•'+@me,''), [$Emotion]+'β˜•'+@me)",
                        "EmotionCount": "=if(length([$EmotionCount])==0,'πŸ™‚0πŸ™0πŸ˜ƒ0πŸ‘0πŸ‘‹0πŸ””0πŸ‘‘0πŸ”Ž0β˜•1|',if(indexOf([$Emotion],'β˜•'+@me) > -1, substring([$EmotionCount],0,indexOf([$EmotionCount],'β˜•')+1)+toString((Number(substring([$EmotionCount],indexOf([$EmotionCount],'β˜•')+1,lastIndexOf([$EmotionCount],'|'))))-1)+substring([$EmotionCount],lastIndexOf([$EmotionCount],'|'),indexOf([$EmotionCount]+'.','.')), substring([$EmotionCount],0,indexOf([$EmotionCount],'β˜•')+1)+toString((Number(substring([$EmotionCount],indexOf([$EmotionCount],'β˜•')+1,lastIndexOf([$EmotionCount],'|'))))+1)+substring([$EmotionCount],lastIndexOf([$EmotionCount],'|'),indexOf([$EmotionCount]+'.','.'))))"
                      }
                    }
                  }
                ]
              }
            }
          }
        ]
      },
      {
        "elmType": "div",
        "style": {
          "display": "inline-block",
          "padding": "5px"
        },
        "children": [
          {
            "elmType": "div",
            "style": {
              "display": "=if(Number(substring([$EmotionCount],indexOf([$EmotionCount],'πŸ™‚')+2,indexOf([$EmotionCount],'πŸ™'))) >0,'inline-block','none')",
              "padding": "0px 0px 0px 5px"
            },
            "children": [
              {
                "elmType": "div",
                "attributes": {
                  "class": "ms-bgColor-communicationTint20--hover"
                },
                "style": {
                  "border": "1px solid #ccc",
                  "border-radius": "5px",
                  "padding-left": "5px"
                },
                "children": [
                  {
                    "elmType": "div",
                    "style": {
                      "padding": "5px",
                      "cursor": "pointer",
                      "display": "inline-block"
                    },
                    "attributes": {
                      "class": "ms-fontSize-20"
                    },
                    "txtContent": "πŸ™‚"
                  },
                  {
                    "elmType": "div",
                    "style": {
                      "padding": "5px",
                      "cursor": "pointer",
                      "display": "inline-block"
                    },
                    "attributes": {
                      "class": "ms-fontSize-20"
                    },
                    "txtContent": "=Number(substring([$EmotionCount],indexOf([$EmotionCount],'πŸ™‚')+2,indexOf([$EmotionCount],'πŸ™')))"
                  }
                ]
              }
            ],
            "customRowAction": {
              "action": "setValue",
              "actionInput": {
                "Emotion": "=if(indexOf([$Emotion],'πŸ™‚'+@me) > -1, replace([$Emotion],'πŸ™‚'+@me,''), [$Emotion]+'πŸ™‚'+@me)",
                "EmotionCount": "=if(indexOf([$Emotion],'πŸ™‚'+@me) > -1, substring([$EmotionCount],0,indexOf([$EmotionCount],'πŸ™‚')+2)+toString((Number(substring([$EmotionCount],indexOf([$EmotionCount],'πŸ™‚')+2,lastIndexOf([$EmotionCount],'πŸ™'))))-1)+substring([$EmotionCount],lastIndexOf([$EmotionCount],'πŸ™'),indexOf([$EmotionCount]+'.','.')), substring([$EmotionCount],0,indexOf([$EmotionCount],'πŸ™‚')+2)+toString((Number(substring([$EmotionCount],indexOf([$EmotionCount],'πŸ™‚')+2,lastIndexOf([$EmotionCount],'πŸ™'))))+1)+substring([$EmotionCount],lastIndexOf([$EmotionCount],'πŸ™'),indexOf([$EmotionCount]+'.','.')))"
              }
            }
          },
          {
            "elmType": "div",
            "style": {
              "display": "=if(Number(substring([$EmotionCount],indexOf([$EmotionCount],'πŸ™')+2,indexOf([$EmotionCount],'πŸ˜ƒ'))) >0,'inline-block','none')",
              "padding": "0px 0px 0px 5px"
            },
            "children": [
              {
                "elmType": "div",
                "style": {
                  "border": "1px solid #ccc",
                  "border-radius": "5px",
                  "padding-left": "5px"
                },
                "attributes": {
                  "class": "ms-bgColor-communicationTint20--hover"
                },
                "children": [
                  {
                    "elmType": "div",
                    "style": {
                      "padding": "5px",
                      "cursor": "pointer",
                      "display": "inline-block"
                    },
                    "attributes": {
                      "class": "ms-fontSize-20"
                    },
                    "txtContent": "πŸ™"
                  },
                  {
                    "elmType": "div",
                    "style": {
                      "padding": "5px",
                      "cursor": "pointer",
                      "display": "inline-block"
                    },
                    "attributes": {
                      "class": "ms-fontSize-20"
                    },
                    "txtContent": "=Number(substring([$EmotionCount],indexOf([$EmotionCount],'πŸ™')+2,indexOf([$EmotionCount],'πŸ˜ƒ')))"
                  }
                ]
              }
            ],
            "customRowAction": {
              "action": "setValue",
              "actionInput": {
                "Emotion": "=if(indexOf([$Emotion],'πŸ™'+@me) > -1, replace([$Emotion],'πŸ™'+@me,''), [$Emotion]+'πŸ™'+@me)",
                "EmotionCount": "=if(indexOf([$Emotion],'πŸ™'+@me) > -1, substring([$EmotionCount],0,indexOf([$EmotionCount],'πŸ™')+2)+toString((Number(substring([$EmotionCount],indexOf([$EmotionCount],'πŸ™')+2,lastIndexOf([$EmotionCount],'πŸ˜ƒ'))))-1)+substring([$EmotionCount],lastIndexOf([$EmotionCount],'πŸ˜ƒ'),indexOf([$EmotionCount]+'.','.')), substring([$EmotionCount],0,indexOf([$EmotionCount],'πŸ™')+2)+toString((Number(substring([$EmotionCount],indexOf([$EmotionCount],'πŸ™')+2,lastIndexOf([$EmotionCount],'πŸ˜ƒ'))))+1)+substring([$EmotionCount],lastIndexOf([$EmotionCount],'πŸ˜ƒ'),indexOf([$EmotionCount]+'.','.')))"
              }
            }
          },
          {
            "elmType": "div",
            "style": {
              "display": "=if(Number(substring([$EmotionCount],indexOf([$EmotionCount],'πŸ˜ƒ')+2,indexOf([$EmotionCount],'πŸ‘'))) >0,'inline-block','none')",
              "padding": "0px 0px 0px 5px"
            },
            "children": [
              {
                "elmType": "div",
                "style": {
                  "border": "1px solid #ccc",
                  "border-radius": "5px",
                  "padding-left": "5px"
                },
                "attributes": {
                  "class": "ms-bgColor-communicationTint20--hover"
                },
                "children": [
                  {
                    "elmType": "div",
                    "style": {
                      "padding": "5px",
                      "cursor": "pointer",
                      "display": "inline-block"
                    },
                    "attributes": {
                      "class": "ms-fontSize-20"
                    },
                    "txtContent": "πŸ˜ƒ"
                  },
                  {
                    "elmType": "div",
                    "style": {
                      "padding": "5px",
                      "cursor": "pointer",
                      "display": "inline-block"
                    },
                    "attributes": {
                      "class": "ms-fontSize-20"
                    },
                    "txtContent": "=Number(substring([$EmotionCount],indexOf([$EmotionCount],'πŸ˜ƒ')+2,indexOf([$EmotionCount],'πŸ‘')))"
                  }
                ]
              }
            ],
            "customRowAction": {
              "action": "setValue",
              "actionInput": {
                "Emotion": "=if(indexOf([$Emotion],'πŸ˜ƒ'+@me) > -1, replace([$Emotion],'πŸ˜ƒ'+@me,''), [$Emotion]+'πŸ˜ƒ'+@me)",
                "EmotionCount": "=if(indexOf([$Emotion],'πŸ˜ƒ'+@me) > -1, substring([$EmotionCount],0,indexOf([$EmotionCount],'πŸ˜ƒ')+2)+toString((Number(substring([$EmotionCount],indexOf([$EmotionCount],'πŸ˜ƒ')+2,lastIndexOf([$EmotionCount],'πŸ‘'))))-1)+substring([$EmotionCount],lastIndexOf([$EmotionCount],'πŸ‘'),indexOf([$EmotionCount]+'.','.')), substring([$EmotionCount],0,indexOf([$EmotionCount],'πŸ˜ƒ')+2)+toString((Number(substring([$EmotionCount],indexOf([$EmotionCount],'πŸ˜ƒ')+2,lastIndexOf([$EmotionCount],'πŸ‘'))))+1)+substring([$EmotionCount],lastIndexOf([$EmotionCount],'πŸ‘'),indexOf([$EmotionCount]+'.','.')))"
              }
            }
          },
          {
            "elmType": "div",
            "style": {
              "display": "=if(Number(substring([$EmotionCount],indexOf([$EmotionCount],'πŸ‘')+2,indexOf([$EmotionCount],'πŸ‘‹'))) >0,'inline-block','none')",
              "padding": "0px 0px 0px 5px"
            },
            "children": [
              {
                "elmType": "div",
                "style": {
                  "border": "1px solid #ccc",
                  "border-radius": "5px",
                  "padding-left": "5px"
                },
                "attributes": {
                  "class": "ms-bgColor-communicationTint20--hover"
                },
                "children": [
                  {
                    "elmType": "div",
                    "style": {
                      "padding": "5px",
                      "cursor": "pointer",
                      "display": "inline-block"
                    },
                    "attributes": {
                      "class": "ms-fontSize-20"
                    },
                    "txtContent": "πŸ‘"
                  },
                  {
                    "elmType": "div",
                    "style": {
                      "padding": "5px",
                      "cursor": "pointer",
                      "display": "inline-block"
                    },
                    "attributes": {
                      "class": "ms-fontSize-20"
                    },
                    "txtContent": "=Number(substring([$EmotionCount],indexOf([$EmotionCount],'πŸ‘')+2,indexOf([$EmotionCount],'πŸ‘‹')))"
                  }
                ]
              }
            ],
            "customRowAction": {
              "action": "setValue",
              "actionInput": {
                "Emotion": "=if(indexOf([$Emotion],'πŸ‘'+@me) > -1, replace([$Emotion],'πŸ‘'+@me,''), [$Emotion]+'πŸ‘'+@me)",
                "EmotionCount": "=if(indexOf([$Emotion],'πŸ‘'+@me) > -1, substring([$EmotionCount],0,indexOf([$EmotionCount],'πŸ‘')+2)+toString((Number(substring([$EmotionCount],indexOf([$EmotionCount],'πŸ‘')+2,lastIndexOf([$EmotionCount],'πŸ‘‹'))))-1)+substring([$EmotionCount],lastIndexOf([$EmotionCount],'πŸ‘‹'),indexOf([$EmotionCount]+'.','.')), substring([$EmotionCount],0,indexOf([$EmotionCount],'πŸ‘')+2)+toString((Number(substring([$EmotionCount],indexOf([$EmotionCount],'πŸ‘')+2,lastIndexOf([$EmotionCount],'πŸ‘‹'))))+1)+substring([$EmotionCount],lastIndexOf([$EmotionCount],'πŸ‘‹'),indexOf([$EmotionCount]+'.','.')))"
              }
            }
          },
          {
            "elmType": "div",
            "style": {
              "display": "=if(Number(substring([$EmotionCount],indexOf([$EmotionCount],'πŸ‘‹')+2,indexOf([$EmotionCount],'πŸ””'))) >0,'inline-block','none')",
              "padding": "0px 0px 0px 5px"
            },
            "children": [
              {
                "elmType": "div",
                "style": {
                  "border": "1px solid #ccc",
                  "border-radius": "5px",
                  "padding-left": "5px"
                },
                "attributes": {
                  "class": "ms-bgColor-communicationTint20--hover"
                },
                "children": [
                  {
                    "elmType": "div",
                    "style": {
                      "padding": "5px",
                      "cursor": "pointer",
                      "display": "inline-block"
                    },
                    "attributes": {
                      "class": "ms-fontSize-20"
                    },
                    "txtContent": "πŸ‘‹"
                  },
                  {
                    "elmType": "div",
                    "style": {
                      "padding": "5px",
                      "cursor": "pointer",
                      "display": "inline-block"
                    },
                    "attributes": {
                      "class": "ms-fontSize-20"
                    },
                    "txtContent": "=Number(substring([$EmotionCount],indexOf([$EmotionCount],'πŸ‘‹')+2,indexOf([$EmotionCount],'πŸ””')))"
                  }
                ]
              }
            ],
            "customRowAction": {
              "action": "setValue",
              "actionInput": {
                "Emotion": "=if(indexOf([$Emotion],'πŸ‘‹'+@me) > -1, replace([$Emotion],'πŸ‘‹'+@me,''), [$Emotion]+'πŸ‘‹'+@me)",
                "EmotionCount": "=if(indexOf([$Emotion],'πŸ‘‹'+@me) > -1, substring([$EmotionCount],0,indexOf([$EmotionCount],'πŸ‘‹')+2)+toString((Number(substring([$EmotionCount],indexOf([$EmotionCount],'πŸ‘‹')+2,lastIndexOf([$EmotionCount],'πŸ””'))))-1)+substring([$EmotionCount],lastIndexOf([$EmotionCount],'πŸ””'),indexOf([$EmotionCount]+'.','.')), substring([$EmotionCount],0,indexOf([$EmotionCount],'πŸ‘‹')+2)+toString((Number(substring([$EmotionCount],indexOf([$EmotionCount],'πŸ‘‹')+2,lastIndexOf([$EmotionCount],'πŸ””'))))+1)+substring([$EmotionCount],lastIndexOf([$EmotionCount],'πŸ””'),indexOf([$EmotionCount]+'.','.')))"
              }
            }
          },
          {
            "elmType": "div",
            "style": {
              "display": "=if(Number(substring([$EmotionCount],indexOf([$EmotionCount],'πŸ””')+2,indexOf([$EmotionCount],'πŸ‘‘'))) >0,'inline-block','none')",
              "padding": "0px 0px 0px 5px"
            },
            "children": [
              {
                "elmType": "div",
                "style": {
                  "border": "1px solid #ccc",
                  "border-radius": "5px",
                  "padding-left": "5px"
                },
                "attributes": {
                  "class": "ms-bgColor-communicationTint20--hover"
                },
                "children": [
                  {
                    "elmType": "div",
                    "style": {
                      "padding": "5px",
                      "cursor": "pointer",
                      "display": "inline-block"
                    },
                    "attributes": {
                      "class": "ms-fontSize-20"
                    },
                    "txtContent": "πŸ””"
                  },
                  {
                    "elmType": "div",
                    "style": {
                      "padding": "5px",
                      "cursor": "pointer",
                      "display": "inline-block"
                    },
                    "attributes": {
                      "class": "ms-fontSize-20"
                    },
                    "txtContent": "=Number(substring([$EmotionCount],indexOf([$EmotionCount],'πŸ””')+2,indexOf([$EmotionCount],'πŸ‘‘')))"
                  }
                ]
              }
            ],
            "customRowAction": {
              "action": "setValue",
              "actionInput": {
                "Emotion": "=if(indexOf([$Emotion],'πŸ””'+@me) > -1, replace([$Emotion],'πŸ””'+@me,''), [$Emotion]+'πŸ””'+@me)",
                "EmotionCount": "=if(indexOf([$Emotion],'πŸ””'+@me) > -1, substring([$EmotionCount],0,indexOf([$EmotionCount],'πŸ””')+2)+toString((Number(substring([$EmotionCount],indexOf([$EmotionCount],'πŸ””')+2,lastIndexOf([$EmotionCount],'πŸ‘‘'))))-1)+substring([$EmotionCount],lastIndexOf([$EmotionCount],'πŸ‘‘'),indexOf([$EmotionCount]+'.','.')), substring([$EmotionCount],0,indexOf([$EmotionCount],'πŸ””')+2)+toString((Number(substring([$EmotionCount],indexOf([$EmotionCount],'πŸ””')+2,lastIndexOf([$EmotionCount],'πŸ‘‘'))))+1)+substring([$EmotionCount],lastIndexOf([$EmotionCount],'πŸ‘‘'),indexOf([$EmotionCount]+'.','.')))"
              }
            }
          },
          {
            "elmType": "div",
            "style": {
              "display": "=if(Number(substring([$EmotionCount],indexOf([$EmotionCount],'πŸ‘‘')+2,indexOf([$EmotionCount],'πŸ”Ž'))) >0,'inline-block','none')",
              "padding-left": "5px"
            },
            "children": [
              {
                "elmType": "div",
                "style": {
                  "display": "inline-block",
                  "padding": "0px 0px 0px 5px"
                },
                "children": [
                  {
                    "elmType": "div",
                    "style": {
                      "border": "1px solid #ccc",
                      "border-radius": "5px",
                      "display": "inline-block",
                      "padding-left": "5px"
                    },
                    "attributes": {
                      "class": "ms-bgColor-communicationTint20--hover"
                    },
                    "children": [
                      {
                        "elmType": "div",
                        "style": {
                          "padding": "5px",
                          "cursor": "pointer",
                          "display": "inline-block"
                        },
                        "attributes": {
                          "class": "ms-fontSize-20"
                        },
                        "txtContent": "πŸ‘‘"
                      },
                      {
                        "elmType": "div",
                        "style": {
                          "padding": "5px",
                          "cursor": "pointer",
                          "display": "inline-block"
                        },
                        "attributes": {
                          "class": "ms-fontSize-20"
                        },
                        "txtContent": "=Number(substring([$EmotionCount],indexOf([$EmotionCount],'πŸ‘‘')+2,indexOf([$EmotionCount],'πŸ”Ž')))"
                      }
                    ]
                  }
                ]
              }
            ],
            "customRowAction": {
              "action": "setValue",
              "actionInput": {
                "Emotion": "=if(indexOf([$Emotion],'πŸ‘‘'+@me) > -1, replace([$Emotion],'πŸ‘‘'+@me,''), [$Emotion]+'πŸ‘‘'+@me)",
                "EmotionCount": "=if(indexOf([$Emotion],'πŸ‘‘'+@me) > -1, substring([$EmotionCount],0,indexOf([$EmotionCount],'πŸ‘‘')+2)+toString((Number(substring([$EmotionCount],indexOf([$EmotionCount],'πŸ‘‘')+2,lastIndexOf([$EmotionCount],'πŸ”Ž'))))-1)+substring([$EmotionCount],lastIndexOf([$EmotionCount],'πŸ”Ž'),indexOf([$EmotionCount]+'.','.')), substring([$EmotionCount],0,indexOf([$EmotionCount],'πŸ‘‘')+2)+toString((Number(substring([$EmotionCount],indexOf([$EmotionCount],'πŸ‘‘')+2,lastIndexOf([$EmotionCount],'πŸ”Ž'))))+1)+substring([$EmotionCount],lastIndexOf([$EmotionCount],'πŸ”Ž'),indexOf([$EmotionCount]+'.','.')))"
              }
            }
          },
          {
            "elmType": "div",
            "style": {
              "display": "=if(Number(substring([$EmotionCount],indexOf([$EmotionCount],'πŸ”Ž')+2,indexOf([$EmotionCount],'β˜•'))) >0,'inline-block','none')",
              "padding-left": "5px"
            },
            "children": [
              {
                "elmType": "div",
                "style": {
                  "border": "1px solid #ccc",
                  "border-radius": "5px",
                  "display": "inline-block",
                  "padding-left": "5px"
                },
                "attributes": {
                  "class": "ms-bgColor-communicationTint20--hover"
                },
                "children": [
                  {
                    "elmType": "div",
                    "style": {
                      "padding": "5px",
                      "cursor": "pointer",
                      "display": "inline-block"
                    },
                    "attributes": {
                      "class": "ms-fontSize-20"
                    },
                    "txtContent": "πŸ”Ž"
                  },
                  {
                    "elmType": "div",
                    "style": {
                      "padding": "5px",
                      "cursor": "pointer",
                      "display": "inline-block"
                    },
                    "attributes": {
                      "class": "ms-fontSize-20"
                    },
                    "txtContent": "=Number(substring([$EmotionCount],indexOf([$EmotionCount],'πŸ”Ž')+2,indexOf([$EmotionCount],'β˜•')))"
                  }
                ]
              }
            ],
            "customRowAction": {
              "action": "setValue",
              "actionInput": {
                "Emotion": "=if(indexOf([$Emotion],'πŸ”Ž'+@me) > -1, replace([$Emotion],'πŸ”Ž'+@me,''), [$Emotion]+'πŸ”Ž'+@me)",
                "EmotionCount": "=if(indexOf([$Emotion],'πŸ”Ž'+@me) > -1, substring([$EmotionCount],0,indexOf([$EmotionCount],'πŸ”Ž')+2)+toString((Number(substring([$EmotionCount],indexOf([$EmotionCount],'πŸ”Ž')+2,lastIndexOf([$EmotionCount],'β˜•'))))-1)+substring([$EmotionCount],lastIndexOf([$EmotionCount],'β˜•'),indexOf([$EmotionCount]+'.','.')), substring([$EmotionCount],0,indexOf([$EmotionCount],'πŸ”Ž')+2)+toString((Number(substring([$EmotionCount],indexOf([$EmotionCount],'πŸ”Ž')+2,lastIndexOf([$EmotionCount],'β˜•'))))+1)+substring([$EmotionCount],lastIndexOf([$EmotionCount],'β˜•'),indexOf([$EmotionCount]+'.','.')))"
              }
            }
          },
          {
            "elmType": "div",
            "style": {
              "display": "=if(Number(substring([$EmotionCount],indexOf([$EmotionCount],'β˜•')+1,lastIndexOf([$EmotionCount],'|'))) >0,'inline-block','none')",
              "padding-left": "5px"
            },
            "children": [
              {
                "elmType": "div",
                "style": {
                  "border": "1px solid #ccc",
                  "border-radius": "5px",
                  "padding-left": "5px"
                },
                "attributes": {
                  "class": "ms-bgColor-communicationTint20--hover"
                },
                "children": [
                  {
                    "elmType": "div",
                    "style": {
                      "padding": "5px",
                      "cursor": "pointer",
                      "display": "inline-block"
                    },
                    "attributes": {
                      "class": "ms-fontSize-20"
                    },
                    "txtContent": "β˜•"
                  },
                  {
                    "elmType": "div",
                    "style": {
                      "padding": "5px",
                      "cursor": "pointer",
                      "display": "inline-block"
                    },
                    "attributes": {
                      "class": "ms-fontSize-20"
                    },
                    "txtContent": "=Number(substring([$EmotionCount],indexOf([$EmotionCount],'β˜•')+1,lastIndexOf([$EmotionCount],'|')))"
                  }
                ]
              }
            ],
            "customRowAction": {
              "action": "setValue",
              "actionInput": {
                "Emotion": "=if(indexOf([$Emotion],'β˜•'+@me) > -1, replace([$Emotion],'β˜•'+@me,''), [$Emotion]+'β˜•'+@me)",
                "EmotionCount": "=if(indexOf([$Emotion],'β˜•'+@me) > -1, substring([$EmotionCount],0,indexOf([$EmotionCount],'β˜•')+1)+toString((Number(substring([$EmotionCount],indexOf([$EmotionCount],'β˜•')+1,lastIndexOf([$EmotionCount],'|'))))-1)+substring([$EmotionCount],lastIndexOf([$EmotionCount],'|'),indexOf([$EmotionCount]+'.','.')), substring([$EmotionCount],0,indexOf([$EmotionCount],'β˜•')+1)+toString((Number(substring([$EmotionCount],indexOf([$EmotionCount],'β˜•')+1,lastIndexOf([$EmotionCount],'|'))))+1)+substring([$EmotionCount],lastIndexOf([$EmotionCount],'|'),indexOf([$EmotionCount]+'.','.')))"
              }
            }
          }
        ]
      }
    ]
  }
}

From the contributor

How to use this sample

Summary

This sample demonstrates reacting with an emoji. Who reacted and the total counts per reaction are stored with the list item.

Two versions are provided. The first, emoji-reactions.json, displays the reactions of the current user and allows them to react. The section, emoji-reactions-count.json, displays reactions from all users and the count of each reaction type.

screenshot of the sample

emoji-reactions-count.json

emotions format

  • Below provides how the counting board is organized by users.

View requirements

  • The format expect the following fields:
Field Type
Title Single line of text
Emotion Multiple line of text - Stores reactions for users
EmotionCount Single line of text - Stores count of reactions

Here's how the storage looks behind the scenes:

storage

Sample

Solution Author(s)
emoji-reactions.json AndrΓ© Lage
emoji-reactions-count.json AndrΓ© Lage

Version history

Version Date Comments
1.0 January 12, 2022 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.


Additional notes

None