Skip to content

Instantly share code, notes, and snippets.

View List Color Boxes
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
View Binary ASCII Character Collection - Power Apps.txt
If(CountRows(binaryDigits)=0,
ClearCollect(binaryDigits,[]);
ForAll(Sequence(8,7,-1),
Collect(binaryDigits, {
index: Value,
worth: Power(2,Value)
})
)
);
View Int To Binary - Power Apps.txt
If(CountRows(binaryDigits)=0,
ClearCollect(binaryDigits,[]);
ForAll(Sequence(31,30,-1),
Collect(binaryDigits, {
index: Value,
worth: Power(2,Value)
})
)
);
View Binary To Int - Power Apps.txt
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)
View Taxonomy Conditional Icon
{
"$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": [
{
View Simple Grouping FAQ View Format
{
"$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 Nov 12, 2020
Quick List Formatting sample illustrating recreating the Title Column
View Title Column.json
{
"elmType": "div",
"children": [
{
"elmType": "button",
"customRowAction": {
"action": "defaultClick"
},
"attributes": {
"class": "ms-fontColor-neutralPrimary ms-borderColor-white ms-borderColor-neutralPrimary--hover"
View ConvertBannerImageUrlToBase64.ps1
# 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")
View UnicornEmojis.json
{
"elmType": "div",
"children": [
{
"elmType": "span",
"txtContent": "🦄",
"style": {
"display": "=if([$Rating] >= 1, 'inherit','none'"
}
},
View Unicorns.json
{
"elmType": "div",
"style": {
"fill": "#ffaaaa"
},
"children": [
{
"elmType": "svg",
"style": {
"width": "18px",