Skip to content

Instantly share code, notes, and snippets.

Dark Red: sp-css-backgroundColor-BgDarkRed sp-css-borderColor-WhiteFont sp-css-color-WhiteFont
Red: sp-css-backgroundColor-BgRed sp-css-borderColor-WhiteFont sp-css-color-WhiteFont
Orange: sp-css-backgroundColor-BgOrange sp-css-borderColor-WhiteFont sp-css-color-WhiteFont
Brown: sp-css-backgroundColor-BgBrown sp-css-borderColor-WhiteFont sp-field-fontSizeSmall sp-css-color-WhiteFont
Green: sp-css-backgroundColor-BgGreen sp-css-borderColor-WhiteFont sp-field-fontSizeSmall sp-css-color-WhiteFont
Teal: sp-css-backgroundColor-BgTeal sp-css-borderColor-WhiteFont sp-field-fontSizeSmall sp-css-color-WhiteFont
Dark Green: sp-css-backgroundColor-BgDarkGreen sp-css-borderColor-WhiteFont sp-field-fontSizeSmall sp-css-color-WhiteFont
Blue: sp-css-backgroundColor-BgBlue sp-css-borderColor-WhiteFont sp-field-fontSizeSmall sp-css-color-WhiteFont
Lavender: sp-css-backgroundColor-BgLavender sp-css-borderColor-WhiteFont sp-field-fontSizeSmall sp-css-color-WhiteFont
If(CountRows(binaryDigits)=0,
ClearCollect(binaryDigits,[]);
ForAll(Sequence(8,7,-1),
Collect(binaryDigits, {
index: Value,
worth: Power(2,Value)
})
)
);
If(CountRows(binaryDigits)=0,
ClearCollect(binaryDigits,[]);
ForAll(Sequence(31,30,-1),
Collect(binaryDigits, {
index: Value,
worth: Power(2,Value)
})
)
);
ClearCollect(binaryToInt,[]);
With({
input: txtFromBinary.Text
},
ForAll(Sequence(Len(input)),
With({
binaryDigit: Right(Left(input,Len(input)-(Value-1)),1) //Grab the right most digit
},
Collect(binaryToInt,{
binaryDigit: binaryDigit, //Not necessary (debug)
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"style": {
"display": "=if(@currentField,'flex','none')",
"flex-wrap": "wrap",
"width": "100%"
},
"children": [
{
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/view-formatting.schema.json",
"hideColumnHeader": true,
"hideSelection": true,
"groupProps": {
"headerFormatter": {
"elmType": "div",
"txtContent": "@group.fieldData"
}
}
@thechriskent
thechriskent / Title Column.json
Last active November 12, 2020 20:51
Quick List Formatting sample illustrating recreating the Title Column
{
"elmType": "div",
"children": [
{
"elmType": "button",
"customRowAction": {
"action": "defaultClick"
},
"attributes": {
"class": "ms-fontColor-neutralPrimary ms-borderColor-white ms-borderColor-neutralPrimary--hover"
# Connect to your site
# (this example assumes an entry in Windows Credential Manager,
# but you can pass credentials however you need here)
Connect-PnPOnline https://yourtenant.sharepoint.com/sites/yoursite
$connection = Get-PnPConnection
# Setup a Web Client using credentials pulled from the connection
$client = New-Object System.Net.WebClient
$client.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($connection.PSCredential.UserName, $connection.PSCredential.Password)
$client.Headers.Add("X-FORMS_BASED_AUTH_ACCEPTED", "f")
{
"elmType": "div",
"children": [
{
"elmType": "span",
"txtContent": "🦄",
"style": {
"display": "=if([$Rating] >= 1, 'inherit','none'"
}
},
{
"elmType": "div",
"style": {
"fill": "#ffaaaa"
},
"children": [
{
"elmType": "svg",
"style": {
"width": "18px",