SlideShare a Scribd company logo
LIST FORMATTING IN OFFICE 365 AND SHAREPOINT 2019
Chris Kent
O365 Practice Lead
DMI
♡ DIAMOND AND PLATINUM SPONSORS ♡
ECS19 - Chris Kent - List Formatting in Office 365 and SharePoint 2019
theChri sKent.c omaka.ms/sppnp
@theChrisKent
theChrisKent.com
Office 365 Practice Lead
Indianapolis, IN
theChri sKent.c omaka.ms/sppnp
GOALS
theChri sKent.c omaka.ms/sppnp
COLUMN
FORMATTING
What | Why | How
theChri sKent.c omaka.ms/sppnp
What | Why | How
VIEW
FORMATTING
theChri sKent.c omaka.ms/sppnp
RESOURCES
Samples | Guidance | Tools
ECS19 - Chris Kent - List Formatting in Office 365 and SharePoint 2019
theChri sKent.c omaka.ms/sppnp
The Modern Listview
• Responsive
• Fancy
• Boring
• No XSLT
• No Calculated Column
Trickery
theChri sKent.c omaka.ms/sppnp
The Modern Listview
theChri sKent.c omaka.ms/sppnp
List Formatting
Declarative
modern listview
customization
Column Formatting
View Formatting
theChri sKent.c omaka.ms/sppnp
List formatting allows you to quickly and easily
add instant meaning, visual appeal, and
dynamic visualizations directly to your lists.
theChri sKent.c omaka.ms/sppnp
Checkboxes
vs
Yes/No
Missed Due
Dates in
Red
List formatting allows you to quickly and easily
add instant meaning, visual appeal, and
dynamic visualizations directly to your lists.
List formatting allows you to quickly and easily
add instant meaning, visual appeal, and
dynamic visualizations directly to your lists.
theChri sKent.c omaka.ms/sppnp
List formatting allows you to quickly and easily
add instant meaning, visual appeal, and
dynamic visualizations directly to your lists.
theChri sKent.c omaka.ms/sppnp
Items Assigned
To the Current
User
Dynamic
Progress
Bars
List formatting allows you to quickly and easily
add instant meaning, visual appeal, and
dynamic visualizations directly to your lists.
theChri sKent.c omaka.ms/sppnp
Column Formatting
• JavaScript Object
Notation (JSON)
• Apply directly to list
fields or site columns
• Field Settings
• Format this column
menu
• Stored with the
Field
Paste
Here
O365 & 2019
theChri sKent.c omaka.ms/sppnp
Column Formatting Design Mode
Calculated Date Columns Too Calculated Yes/No Columns Too
theChri sKent.c omaka.ms/sppnp
Column Formatting Design Mode
Pre-selected
Color Classes
Adjusts for
Dark Themes
Switch to JSON
theChri sKent.c omaka.ms/sppnp
SP-Dev-List-Formatting Samples
• 50+ Sample Formats
• Instructions & Screenshots
• Copy & Paste directly from GitHub
bit.ly/LF-samples
theChri sKent.c omaka.ms/sppnp
Demo: Column Formatting
theChri sKent.c omaka.ms/sppnp
View Formatting
• Superset of Column
Formatting
• Apply directly to views
• Format current view
menu
• Stored with the View
• Overrides Column
Formats (Row Formats)
Paste
Here
Online Only
theChri sKent.c omaka.ms/sppnp
View Formatting Flavors
Row Class Row Format
• Uses additionalRowClass
• Applies class(es) to each
row
• Can be conditionally
applied
• Ignored when
rowFormatter is used
• Uses rowFormatter
• Responsible for full
rendering of the row
Online Only
theChri sKent.c omaka.ms/sppnp
Demo: View Formatting
theChri sKent.c omaka.ms/sppnp
Supported Column Types
• Calculated
• Choice
• ContentType
• Counter (ID)
• Currency*
• Date/Time
• Hyperlink
• Lookup
• Multi-Choice
• Multi-Line Text*
• Multi-Person
• Number
• Person
• Picture
• Single line of
text
• Title (in Lists)
• Yes/No
• Managed Metadata
• Retention Label
• Filename (in Document
Libraries)
Can’t Reference:
Same support applies to both Column and View
Formatting
*Apply Format through Field Settings
theChri sKent.c omaka.ms/sppnp
JSON Syntax Crash Course
• An object is a set of name/value pairs
• Objects begin with a { and end with a }
• Each name is followed by a :
• Name/value pairs are separated by a ,
{
“elmType”: “div”,
“debugMode”: false
}
Adapted from json.org
theChri sKent.c omaka.ms/sppnp
• An object is a set of name/value pairs
• Objects begin with a { and end with a }
• Each name is followed by a :
• Name/value pairs are separated by a ,
• An array is an ordered collection of values
• Arrays begin with a [ and end with a ]
• Array values are separated by a ,
{
“elmType”: “div”,
“debugMode”: false,
“children”: [
{
“elmType”: “span”,
“txtContent”: “Yo”
},
{
“elmType”: “span”,
“txtContent”: “ Dawg!”
}
]
}
Adapted from json.org
JSON Syntax Crash Course
theChri sKent.c omaka.ms/sppnp
{
“elmType”: “div”,
“debugMode”: false,
“children”: [
{
“elmType”: “span”,
“txtContent”: “Yo”
},
{
“elmType”: “span”,
“txtContent”: “ Dawg!”
}
],
“style”: {
“color”: “red”,
“padding-left”: “4px”
}
}
• An object is a set of name/value pairs
• Objects begin with a { and end with a }
• Each name is followed by a :
• Name/value pairs are separated by a ,
• An array is an ordered collection of values
• Arrays begin with a [ and end with a ]
• Array values are separated by a ,
• A value can be a string in double quotes, a
number, true, false, null, object, or array
Adapted from json.org
JSON Syntax Crash Course
theChri sKent.c omaka.ms/sppnp
theChri sKent.c omaka.ms/sppnp
- FORMATTING -
theChri sKent.c omaka.ms/sppnp
- FORMATTING -
theChri sKent.c omaka.ms/sppnp
- FORMATTING -
theChri sKent.c omaka.ms/sppnp
- FORMATTING -
theChri sKent.c omaka.ms/sppnp
- FORMATTING -
theChri sKent.c omaka.ms/sppnp
- FORMATTING -
theChri sKent.c omaka.ms/sppnp
- FORMATTING -
theChri sKent.c omaka.ms/sppnp
div
span span
<div class="sp-field-customFormatter sp-field-severity--severeWarning">
<span style="padding-left:4px;" iconname="Warning" class=" css-148"></span>
<span style="padding-left:4px;">Wise Polar Bear</span>
</div>
Format JSON Rendered Column
Element Visualization
Generated HTML
theChri sKent.c omaka.ms/sppnp
View Formatting Syntax
• hideColumnHeader
• When true, the view won’t have any column headers
• hideSelection
• When true, users can’t select rows
• additionalRowClass
• Class(es) to apply to the whole row
• You can use expressions
• Only applied when rowFormatter is not specified
• rowFormatter
• Column Formatting syntax to create elements
Top level props
theChri sKent.c omaka.ms/sppnp
“elmType”: “”
• div (box)
• span (inline box)
• a (link)
• img (picture)
• button (clicky thing)
• svg (fancy picture)
• path (part of the fancy picture)
Only Required Property
theChri sKent.c omaka.ms/sppnp
Element Content
• txtContent
• Text value
OR
• children
• Sub elements
• Ignored when txtContent is specified
What’s in the Box
theChri sKent.c omaka.ms/sppnp
“attributes”: { }
Everybody
• class – CSS class(es)
• title - tooltip
• iconName – UIFabric icon
• role - accessibility
• aria-* -accessibility
a (links)
• href – where to go
• target – open in new
window or not
• rel – relationship
img
• src – image location
path
• d – path to be drawn
Directly in the element
theChri sKent.c omaka.ms/sppnp
“style”: { }
• background-color
• fill
• background-image
• border
• border-bottom
• border-bottom-color
• border-bottom-style
• border-bottom-width
• border-color
• border-left
• border-left-color
• border-left-style
• border-left-width
• border-right
• border-right-color
• border-right-style
• border-right-width
• border-style
• border-top
• border-top-color
• border-top-style
• border-top-width
• border-width
• outline
• outline-color
• outline-style
• outline-width
• border-bottom-left-radius
• border-bottom-right-
radius
• border-radius
• border-top-left-radius
• border-top-right-radius
• box-decoration-break
• box-shadow
• box-sizing
• overflow-x
• overflow-y
• overflow-style
• rotation
• rotation-point
• opacity
• cursor
• height
• max-height
• max-width
• min-height
• min-width
• width
• flex-grow
• flex-shrink
• flex-flow
• flex-direction
• flex-wrap
• flex
• justify-content
• align-items
• box-align
• box-direction
• box-flex
• box-flex-group
• box-lines
• box-ordinal-group
• box-orient
• box-pack
• font
• font-family
• font-size
• font-style
• font-variant
• font-weight
• font-size-adjust
• font-stretch
• grid-columns
• grid-rows
• margin
• margin-bottom
• margin-left
• margin-right
• margin-top
• column-count
• column-fill
• column-gap
• column-rule
• column-rule-color
• column-rule-style
• column-rule-width
• column-span
• column-width
• columns
• padding
• padding-bottom
• padding-left
• padding-right
• padding-top
• bottom
• clear
• clip
• display
• float
• left
• overflow
• position
• right
• top
• visibility
• z-index
• border-collapse
• border-spacing
• caption-side
• empty-cells
• table-layout
• color
• direction
• letter-spacing
• line-height
• text-align
• text-decoration
• text-indent
• text-transform
• unicode-bidi
• vertical-align
• white-space
• word-spacing
• hanging-punctuation
• punctuation-trim
• text-align-last
• text-justify
• text-outline
• text-shadow
• text-wrap
• word-break
• word-wrap
Nest in the style attribute
132
theChri sKent.c omaka.ms/sppnp
“customRowAction”: { “action”: “”}
• defaultClick – opens the info pane
• editProps – opens the info pane in edit mode
• share – opens the sharing dialog
• delete – opens the delete confirmation dialog
• executeFlow – launches the flow panel
Only work within button elements
(Use the style and children properties to get fancy!)
You cannot use expressions in the action property
theChri sKent.c omaka.ms/sppnp
“customRowAction”: { “actionParams”: “”}
• Only used for “action”: “executeFlow”
• Escaped JSON
• ”ID”: required
• ID of Flow to launch
• ”headerText”: optional
• Sets the text at the top of the flow panel
• ”runFlowButtonText” optional
• text of the primary button
Online Only
theChri sKent.c omaka.ms/sppnp
Live List Updates
• Formats are automatically redrawn as items
update
• Magic
• Does NOT (yet?) work in the list/library web parts
• sadness
Online Only
theChri sKent.c omaka.ms/sppnp
Demo: customRowAction
theChri sKent.c omaka.ms/sppnp
…
“txtContent”: “@currentField”
…
• Works great for simple values (text,
choice, yes/no, and numbers)
• Type is respected
• Dates should use one of the format
operations:
“toLocaleString()” – date and time
“toLocaleDateString()” – just the date
“toLocaleTimeString()” – just the time
• Always resolves to Title in view
formatting
Placeholder Tokens
• “@currentField”
• Get the current item’s
value
theChri sKent.c omaka.ms/sppnp
…
“txtContent”: “@currentField.title”
…
• Can’t use “@currentField” directly, use
dot-notation to get properties:
“@currentField.title”
“@currentField.id”
“@currentField.email”
“@currentField.sip”
“@currentField.picture”
“@currentField.department”
“@currentField.jobTitle”
• Person field props
Placeholder Tokens
• “@currentField”
• Get the current item’s
value
theChri sKent.c omaka.ms/sppnp
…
“txtContent”:
“@currentField.lookupValue”
…
• Can’t use @currentField directly, use
dot-notation to get properties:
“@currentField.lookupValue”
“@currentField.lookupId”
• Person field props
• Lookup field props
Placeholder Tokens
• “@currentField”
• Get the current item’s
value
theChri sKent.c omaka.ms/sppnp
• Person field props
• Lookup field props
• Hyperlink field props
…
“txtContent”:
“@currentField.desc”
…
• Can use @currentField directly AND
dot-notation to get properties:
“@currentField” – URL value
“@currentField.desc” - Description
Placeholder Tokens
• “@currentField”
• Get the current item’s
value
theChri sKent.c omaka.ms/sppnp
…
“txtContent”: “[$Title]”
…
• Wrap internal name in [$FIELD]
• Access Person/Lookup/URL properties
in same way as with @currentField
“[$Author.email]”
“[$OtherListItem.lookupValue]”
• Person field props
• Lookup field props
• Other Fields (same row)
• Hyperlink field props
Placeholder Tokens
• “@currentField”
• Get the current item’s
value
theChri sKent.c omaka.ms/sppnp
…
“txtContent”: “@me”
…
• “@me” resolves to the current user’s
email address
• “@now” resolves to the date/time
at render (doesn’t keep getting evaluated)
• Uses the browser’s timezone!
• Person field props
• Lookup field props
• Other Fields (same row)
• Hyperlink field props
• “@me”
• “@now”
Placeholder Tokens
• “@currentField”
• Get the current item’s
value
theChri sKent.c omaka.ms/sppnp
Placeholder Tokens …
“txtContent”:
“@window.innerHeight”
…
• “@window.innerHeight” resolves to a
number equal to the height of the
browser window (in pixels) at render
• “@window.innerWidth” resolves to a
number equal to the width of the
browser window (in pixels) at render
• Person field props
• Lookup field props
• Other Fields (same row)
• Hyperlink field props
• “@me”
• “@now”
• “@window”
These do NOT update
as the window resizes
• “@currentField”
• Get the current item’s
value
Online Only
theChri sKent.c omaka.ms/sppnp
Placeholder Tokens …
“txtContent”: “@currentWeb”
…
• Same as page context webAbsoluteUrl
• Does not end with a slash
• Other Fields (same row)
• “@me”
• “@now”
• “@window”
• “@currentField”
• “@currentWeb”
• “[$FieldName]”
Hardcoded URL
• Always works
• Not reusable across sites
Relative URL
• Reusable across sites
• URLs dependent on relative location
Online Only
theChri sKent.c omaka.ms/sppnp
Placeholder Tokens …
“txtContent”: “@rowIndex”
…
• Evaluates to the rendered index of a
row within a view
• Independent of sorts or filters
• Starts at 0
• Alternating Rows!
• “@me”
• “@now”
• “@window”
• “@currentField”
• “@currentWeb”
• “[$FieldName]”
Online Only
• “@rowIndex”
theChri sKent.c omaka.ms/sppnp
Placeholder Tokens …
“src”: “@thumbnail.medium”
…
• Provides the URL to the thumbnail of a
file (document libraries only)
• No value for list items or folders
“@thumbnail.small”
“@thumbnail.medium”
“@thumbnail.large”
@thumbnail.<width>x<height>
“@thumbnail.100x200”
@thumbnail.<width>
“@thumbnail.150”
• Aspect ratio is maintained
• Only value of src, auto hidden when
unavailable
• “@me”
• “@now”
• “@window”
• “@currentField”
• “@currentWeb”
• “[$FieldName]”
Online Only
• “@rowIndex”
• “@thumbnail”
theChri sKent.c omaka.ms/sppnp
Expressions
• Abstract Syntax Tree
(AST)
• operator/operands
• Nest additional
expressions
• Excel-style expressions
• Single line
• Combine expressions
• Online Only
theChri sKent.c omaka.ms/sppnp
Expressions
• Abstract Syntax Tree
(AST)
• operator/operands
• Nest additional
expressions
• Excel-style expressions
• Single line
• Combine expressions
• Electrolytes
theChri sKent.c omaka.ms/sppnp
Expressions
• Abstract Syntax Tree
(AST)
• operator/operands
• Nest additional
expressions
• Excel-style expressions
• Single line
• Combine expressions
• Electrolytes
theChri sKent.c omaka.ms/sppnp
Expressions
• Abstract Syntax Tree
(AST)
• operator/operands
• Nest additional
expressions
• Excel-style expressions
• Single line
• Combine expressions
• Electrolytes
theChri sKent.c omaka.ms/sppnp
Arithmetic Operators
Operator Does Examples Results
+ Adds stuff
(numbers & text)
“=4 + 5”
“=@currentWeb+‘/lists‘”
9
https://t.sharepoint.com/sites/s/lists
- Subtracts stuff “=97 - 10” 87
/ Divides stuff “=25 / 5” 5
* Multiplies stuff “=5 * 5” 25
% Modulus* (remainder) “=@rowIndex % 2” 1 or 0
cos Cosine “=cos(5) 0.28366218546322625
sin Sine “=sin(90)” 0.8939966636005579
abs Absolute Value* “=abs(-45)” 45
*Online Only
theChri sKent.c omaka.ms/sppnp
Conditional & Logical Operators
Operator Does Examples Results
? or if if(condition, when true, when false)
< Less than “=if(1 < 2, ’cat’, ’dog’)” cat
> Greater than “=if(1 > 2, ’cat’, ’dog’)” dog
<= Less than or Equal “=if(2 <= 2, ’horse’, ’duck’)” horse
>= Greater than or Equal “=if(2 >= 3, ’horse’, ’duck’)” duck
== Equals “=if(5 == 5, ’badger’, ’hen’)” Badger
!= Not equals “=if(7 != 7, ’badger’, ’hen)” hen
|| Or “=if(1<2 || 1<0, ‘man’, ‘elf’)” man
&& And “=if(1<2 && 1<0, ‘man’, ‘elf’)” elf
This Photo by Unknown Author is licensed under CC BY-SA-NC
theChri sKent.c omaka.ms/sppnp
Conversion Operators
Operator Does Examples Results
toString To text “=toString(45)” “45”
Number To a number “=Number(‘365’)”
“=Number(‘Wowee’)”
“=Number(Date(‘12/26/1981’))”
365
NaN
378190800000
Date To datetime “=Date(‘12/26/1981’)”
“=Date(378190800000)”
12/26/1981 12:00:00 AM
12/26/1981 12:00:00 AM
toLowerCase* Text to lowercase “=toLowerCase(‘DogFood’)” dogfood
toLocaleString Datetime to locale
text
“=toLocaleString(@now)” “5/21/2019, 2:25:12 PM”
toLocaleDateString Datetime to locale
date only text
“=toLocaleDateString(@now)” “5/21/2019”
toLocaleDateTimeString Datetime to locale
time only text
“=toLocaleDateTimeString(@now)” “2:25:12 PM”
*Online Only
theChri sKent.c omaka.ms/sppnp
Mulit-Value & Loop Operators
Operator Does Examples Results
indexOf Character index (starting at 0)
of some text within text
“=indexOf(‘DogFood’, ‘Dog’)”
“=indexOf(‘DogFood’, ‘F’)”
“=indexOf(‘DogFood’, ‘Cat’)”
“=indexOf(‘DogFood’, ‘f’)”
0
3
-1
-1
length Number of multi-value values “=length([$MultiChoice])”
“=length(‘Some Text’)”
“=length(‘’)”
3
1
0
join Turns multi-values into text
with a separator
=“join([$MultiChoice], ‘, ‘)”
=“join([$MultiChoice], ‘|‘)”
“A, B, C”
“A|B|C”
loopIndex Current index of an iterator
(forEach)
“=loopIndex(‘personIterator’)” 2
Online Only
theChri sKent.c omaka.ms/sppnp
Demo: Operators & Tokens
theChri sKent.c omaka.ms/sppnp
Column Formatting vs Field Customizer
theChri sKent.c omaka.ms/sppnp
Column Formatting vs Field Customizer
Customization Column Formatting Field Customizer
Conditional Formatting Supported Supported
theChri sKent.c omaka.ms/sppnp
Column Formatting vs Field Customizer
Customization Column Formatting Field Customizer
Conditional Formatting Supported Supported
Actions Simple actions and links (no script) Any type
theChri sKent.c omaka.ms/sppnp
Column Formatting vs Field Customizer
Customization Column Formatting Field Customizer
Conditional Formatting Supported Supported
Actions Simple actions and links (no script) Any type
Visualizations Static visualizations (HTML & Styles) Whatever!
theChri sKent.c omaka.ms/sppnp
Column Formatting vs Field Customizer
Customization Column Formatting Field Customizer
Conditional Formatting Supported Supported
Actions Simple actions and links (no script) Any type
Visualizations Static visualizations (HTML & Styles) Whatever!
Page Context @now, @me, @window, @currentWeb Full context!
theChri sKent.c omaka.ms/sppnp
Column Formatting vs Field Customizer
Customization Column Formatting Field Customizer
Conditional Formatting Supported Supported
Actions Simple actions and links (no script) Any type
Visualizations Static visualizations (HTML & Styles) Whatever!
Page Context @now, @me, @window, @currentWeb Full context!
JavaScript Nope Yep
Custom CSS Classes Nope, limited subset & inline styles Yep
Interactivity Nope Yep
theChri sKent.c omaka.ms/sppnp
Column Formatting vs Field Customizer
Customization Column Formatting Field Customizer
Conditional Formatting Supported Supported
Actions Simple actions and links (no script) Any type
Visualizations Static visualizations (HTML & Styles) Whatever!
Page Context @now, @me, @window, @currentWeb Full context!
JavaScript Nope Yep
Custom CSS Classes Nope, limited subset & inline styles Yep
Interactivity Nope Yep
Developer Required “No” (but also yes) Yes
Solution Deployment Anyone with Designer Permissions App/Site Catalog
• 90% of list customization use cases can be covered by Column Formatting*
• Another 5% by View Formatting*
• For everything else, use SPFx
*made up by me
theChri sKent.c omaka.ms/sppnp
List Formatting Limitations
• No Real String Operations
• No Custom Date Formats or Date Parts
• No viewbox attribute for SVG elements
• Unable to use parenthesis in style props
(except for rgba)
• No Gradients
• No image backgrounds
• Numbers are floats and you can’t round
them
• Missing ms-Grid support
• Schema discrepancies
• No localization
• List Web Part Inconsistencies & Limits
• Standard User Interface is lacking
theChri sKent.c omaka.ms/sppnp
List Formatting Awesomeness
• Quick & “easy” visualizations that
can have a significant impact
• Site Column integration
• Text based (easy source control)
• Can be applied by Site Designers
• Supported in Site Designs &
Remote Provisioning
• Great performance
• Getting better all the time
• NO Solution Package deployment
required
• List Formatter fills the UI gap
ECS19 - Chris Kent - List Formatting in Office 365 and SharePoint 2019
List Formatter
ListFormatter.com
Easy editor for modern listview Formatting
theChri sKent.c omaka.ms/sppnp
Final Tips & Tricks
• UI Fabric Classes
• Theme Colors
• Hover Styles
• Font Sizes & Weights
• Purge AST from your brain
• Turn debugMode off
• Write HTML 1st
• Dynamic Images
• 1000+ icons – use them!
• Test in multiple themes
• Use List Formatter
The Modern Listview
theChri sKent.c omaka.ms/sppnp
PnP SIG
SharePoint General
Development Call
• Every other Thursday,
16:00 CEST
• Recorded to YouTube
• Next call on 5/30
• Recurring List
Formatting tips & tricks
• currentWeb
• forEach, loopIndex
• Contains, StartsWith, indexOf
• Design Mode
• Alternating Row Styles
• Conditionally launching flows
• Multi-line field formats
• ContentTypes
• Custom Row Actions
• UI Fabric Classes (themed formats)
• Customizing the Flow Panel
• SVG Icons
Previous List Formatting Tips covered
thank you
questions?
THECHRISKENT.COM@THECHRISKENT
ListFormatter.com
bit.lyLF-samples
bit.ly/LF-docs
ECS19 - Chris Kent - List Formatting in Office 365 and SharePoint 2019
theChri sKent.c omaka.ms/sppnp
Extra stuff just for you!
• The next few slides were cut for time
• They still (mostly) have valuable content
• Reach out with any questions (@theChrisKent)
• Enjoy!
theChri sKent.c omaka.ms/sppnp
Predefined Classes
sp-field-severity--good background-color
sp-field-severity--low background-color
sp-field-severity--warning background-color
sp-field-severity--severeWarning background-color
sp-field-severity--blocked background-color
sp-field-dataBars background-color, padding, color, border-top
sp-field-trending--up text color
sp-field-trending--down text color
sp-field-quickActions font, padding (used with icons)
Use UIFabric.io color & typography classes to match theme
theChri sKent.c omaka.ms/sppnp
“attributes”: { “iconName”: “Cat” }
uifabricicons.azurewebsites.net
theChri sKent.c omaka.ms/sppnp
Design Mode Classes
sp-css-backgroundColor-
• neutralBackground (50,40,30)
• blueBackground07 (17,27,37)
• successBackground (50,40,30)
• warningBackground (50,40,30)
• blockingBackground (50,40,30)
• errorBackground (50,40,30)
theChri sKent.c omaka.ms/sppnp
Don’t Use Rich Text
• List Formatting
encodes values
• Rich text values
contain HTML
• HTML will be
encoded and
displayed
theChri sKent.c omaka.ms/sppnp
forEach
• Cannot add to Root Element
• Turns element into a template
• Repeated for each item in the array
• Creates Virtual Field
• Access using Field Syntax [$personIterator]
• Name appropriately (don’t clobber your fields)
• Can be nested
“VirtualFieldName in ArrayField”
@currentField
or
[$SomeOtherField]
theChri sKent.c omaka.ms/sppnp
loopIndex
• Zero-Based
• Position in forEach loop
• Meaningless outside of loop
• Specify the iterator name
• “=loopIndex(‘personIterator’)”
• Rhymes with PoopWindex
theChri sKent.c omaka.ms/sppnp
Scalable Vector Graphics (SVGs)
• “elmType”: “svg”
• “elmType”: “path”
• No viewbox attribute
• Makes them just VGs
• Provides lots of options, but can get confusing
• Use with care
• Dynamic SVGs using expressions in d attribute!
theChri sKent.c omaka.ms/sppnp
ECS19 - Chris Kent - List Formatting in Office 365 and SharePoint 2019
theChri sKent.c omaka.ms/sppnp
Bi-Weekly
SP General Development
• aka.ms/sppnp-core-sig-call
• List Formatting, PowerApps, CSOM,
PowerShell, Provisioning, Flow
• Next Call: Thursday, 2/21
Bi-Weekly
SharePoint Framework
• aka.ms/sppnp-js-sig-call
• SPFx, PnP JS Core
• Next Call: Thursday, 2/14
Monthly
Community Calls
• aka.ms/sppnp-call
• Monthly Summary
• Next Call: Tuesday, 3/12
Bi-Weekly
SP General Development
• aka.ms/sppnp-core-sig-call
• List Formatting, PowerApps, CSOM,
PowerShell, Provisioning, Flow
• Next Call: Thursday, 5/30
Bi-Weekly
SharePoint Framework
• aka.ms/sppnp-js-sig-call
• SPFx, PnP JS Core
• Next Call: Thursday, 5/23
Monthly
Community Calls
• aka.ms/sppnp-call
• Monthly Summary
• Next Call: Tuesday, 6/11
theChri sKent.c omaka.ms/sppnp
Official Blog
dev.office.com/blogs
Twitter
@OfficeDevPnP
Tech Community
aka.ms/sppnp-
community
ECS19 - Chris Kent - List Formatting in Office 365 and SharePoint 2019

More Related Content

PPTX
Organizational Structure
PDF
Predatory journals 2019
PPTX
Gis biosis,medline and medlars
PDF
Impact of Artificial Intelligence (AI) on Libraries
PDF
How to check indexing of publications
PPTX
Z39.50: Information Retrieval protocol ppt
PPTX
Indexing Techniques: Their Usage in Search Engines for Information Retrieval
Organizational Structure
Predatory journals 2019
Gis biosis,medline and medlars
Impact of Artificial Intelligence (AI) on Libraries
How to check indexing of publications
Z39.50: Information Retrieval protocol ppt
Indexing Techniques: Their Usage in Search Engines for Information Retrieval

What's hot (6)

PPTX
Current trends in library science research
PPT
ELECTRONIC THESES AND DISSERTATIONS IN SHODHGANGA REPOSITORY: A COMPARATIVE ...
PPSX
LIS Education (World Wide ‎Overview) ‎
PPT
RFID for Modern libraries
PPTX
mendely.pptx
PPTX
VRA Core 4.0
Current trends in library science research
ELECTRONIC THESES AND DISSERTATIONS IN SHODHGANGA REPOSITORY: A COMPARATIVE ...
LIS Education (World Wide ‎Overview) ‎
RFID for Modern libraries
mendely.pptx
VRA Core 4.0
Ad

Similar to ECS19 - Chris Kent - List Formatting in Office 365 and SharePoint 2019 (20)

PPTX
MS o365 list formatting used in SharePoint Online
KEY
Advanced sass/compass
PPTX
Oooh shiny
PDF
DotNetNuke World CSS3
PPT
Web development basics (Part-3)
PDF
Артем Яворский "Compile like it's 2017"
PDF
Intro to html, css & sass
PPT
Basic css
PPTX
MTA managing the graphical interface by using css
PDF
CSS workshop @ OutSystems
PDF
PDF
Embracing a Taxonomy of Types to Simplify Machine Learning with Leah McGuire
PPTX
Doing More With Less
PDF
Graph abstraction
PPTX
saikiran front end ppt.pptx
PDF
Abhilash front end ppt.pdf
ZIP
URUG Ruby on Rails Workshop - Sesssion 5
PPTX
WordPress for the 99%
PDF
PDF
FP Days: Down the Clojure Rabbit Hole
MS o365 list formatting used in SharePoint Online
Advanced sass/compass
Oooh shiny
DotNetNuke World CSS3
Web development basics (Part-3)
Артем Яворский "Compile like it's 2017"
Intro to html, css & sass
Basic css
MTA managing the graphical interface by using css
CSS workshop @ OutSystems
Embracing a Taxonomy of Types to Simplify Machine Learning with Leah McGuire
Doing More With Less
Graph abstraction
saikiran front end ppt.pptx
Abhilash front end ppt.pdf
URUG Ruby on Rails Workshop - Sesssion 5
WordPress for the 99%
FP Days: Down the Clojure Rabbit Hole
Ad

More from European Collaboration Summit (20)

PDF
ECS19 - Bram De Jager - Design a secure collaboration solution with Azure In...
PPTX
ECS19 - Eric Harlan - Increasing throughput of Office 365
PPTX
ECS19 - Ahmad Najjar - Logic Apps vs Microsoft Flow - When, how and where?
PPTX
ECS19 - Michael Van Horenbeeck - Divide Et Imperat Office 365 Mergers, Acquis...
PPTX
ECS19 - Christina Wheeler - Become Data Modeling Superhero
PPTX
ECS19 - Ahmad Najjar and Serge Luca - Power Platform Tutorial
PPTX
ECS19 - Vesa Juvonen - SharePoint and Office 365 Development PowerClass
PPTX
ECS19 - Paolo Pialorsi - Building Portals with modern SharePoint experiences
PPTX
ECS19 - Nik Charlebois - Automate the Deployment & Monitoring of SharePoint w...
PPTX
ECS19 - Nicki Borell - Microsoft Cybersecurity Reference Architecture
PPTX
ECS19 - Mike Ammerlaan - Microsoft Graph Data Connect
PPTX
ECS19 - Vesa Juvonen, Paolo Pialorsi - Building “modern” portals with SharePo...
PPTX
ECS19 - Vesa Juvonen - Getting Started With SharePoint Framework - Roadmap
PDF
ECS19 - Bill Ayers - UNLOCK YOUR BUSINESS KNOWLEDGE WITH THE MICROSOFT GRAPH,...
PPTX
ECS19 - Toni Pohl - Develop intelligent apps for the Modern Workplace
PPTX
ECS19 - Tomislav Lulic - What is changed in product/service licensing with Cl...
PDF
ECS19 - Thomas Vochten - ESSENTIAL DATABASE ADMINISTRATION SKILLS FOR SHAREPO...
PPTX
ECS19 - Thomas Goelles, Stephan Bisser - Unite your workplace with Microsoft'...
PPTX
ECS19 - Steven Collier - Live Events in Teams, Yammer and Stream using Extern...
PDF
ECS19 - Serge Luca - MICROSOFT FLOW IN REAL WORLD PROJECTS: 3 YEARS LATER AN...
ECS19 - Bram De Jager - Design a secure collaboration solution with Azure In...
ECS19 - Eric Harlan - Increasing throughput of Office 365
ECS19 - Ahmad Najjar - Logic Apps vs Microsoft Flow - When, how and where?
ECS19 - Michael Van Horenbeeck - Divide Et Imperat Office 365 Mergers, Acquis...
ECS19 - Christina Wheeler - Become Data Modeling Superhero
ECS19 - Ahmad Najjar and Serge Luca - Power Platform Tutorial
ECS19 - Vesa Juvonen - SharePoint and Office 365 Development PowerClass
ECS19 - Paolo Pialorsi - Building Portals with modern SharePoint experiences
ECS19 - Nik Charlebois - Automate the Deployment & Monitoring of SharePoint w...
ECS19 - Nicki Borell - Microsoft Cybersecurity Reference Architecture
ECS19 - Mike Ammerlaan - Microsoft Graph Data Connect
ECS19 - Vesa Juvonen, Paolo Pialorsi - Building “modern” portals with SharePo...
ECS19 - Vesa Juvonen - Getting Started With SharePoint Framework - Roadmap
ECS19 - Bill Ayers - UNLOCK YOUR BUSINESS KNOWLEDGE WITH THE MICROSOFT GRAPH,...
ECS19 - Toni Pohl - Develop intelligent apps for the Modern Workplace
ECS19 - Tomislav Lulic - What is changed in product/service licensing with Cl...
ECS19 - Thomas Vochten - ESSENTIAL DATABASE ADMINISTRATION SKILLS FOR SHAREPO...
ECS19 - Thomas Goelles, Stephan Bisser - Unite your workplace with Microsoft'...
ECS19 - Steven Collier - Live Events in Teams, Yammer and Stream using Extern...
ECS19 - Serge Luca - MICROSOFT FLOW IN REAL WORLD PROJECTS: 3 YEARS LATER AN...

Recently uploaded (20)

PPTX
L1 - Introduction to python Backend.pptx
PPTX
CHAPTER 2 - PM Management and IT Context
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
Digital Strategies for Manufacturing Companies
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
Nekopoi APK 2025 free lastest update
PDF
Softaken Excel to vCard Converter Software.pdf
PPTX
ai tools demonstartion for schools and inter college
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
L1 - Introduction to python Backend.pptx
CHAPTER 2 - PM Management and IT Context
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
2025 Textile ERP Trends: SAP, Odoo & Oracle
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
How to Migrate SBCGlobal Email to Yahoo Easily
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Digital Strategies for Manufacturing Companies
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Nekopoi APK 2025 free lastest update
Softaken Excel to vCard Converter Software.pdf
ai tools demonstartion for schools and inter college
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Design an Analysis of Algorithms I-SECS-1021-03
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...

ECS19 - Chris Kent - List Formatting in Office 365 and SharePoint 2019

  • 1. LIST FORMATTING IN OFFICE 365 AND SHAREPOINT 2019 Chris Kent O365 Practice Lead DMI
  • 2. ♡ DIAMOND AND PLATINUM SPONSORS ♡
  • 7. theChri sKent.c omaka.ms/sppnp What | Why | How VIEW FORMATTING
  • 10. theChri sKent.c omaka.ms/sppnp The Modern Listview • Responsive • Fancy • Boring • No XSLT • No Calculated Column Trickery
  • 14. theChri sKent.c omaka.ms/sppnp List formatting allows you to quickly and easily add instant meaning, visual appeal, and dynamic visualizations directly to your lists.
  • 15. theChri sKent.c omaka.ms/sppnp Checkboxes vs Yes/No Missed Due Dates in Red List formatting allows you to quickly and easily add instant meaning, visual appeal, and dynamic visualizations directly to your lists. List formatting allows you to quickly and easily add instant meaning, visual appeal, and dynamic visualizations directly to your lists.
  • 16. theChri sKent.c omaka.ms/sppnp List formatting allows you to quickly and easily add instant meaning, visual appeal, and dynamic visualizations directly to your lists.
  • 17. theChri sKent.c omaka.ms/sppnp Items Assigned To the Current User Dynamic Progress Bars List formatting allows you to quickly and easily add instant meaning, visual appeal, and dynamic visualizations directly to your lists.
  • 18. theChri sKent.c omaka.ms/sppnp Column Formatting • JavaScript Object Notation (JSON) • Apply directly to list fields or site columns • Field Settings • Format this column menu • Stored with the Field Paste Here O365 & 2019
  • 19. theChri sKent.c omaka.ms/sppnp Column Formatting Design Mode Calculated Date Columns Too Calculated Yes/No Columns Too
  • 20. theChri sKent.c omaka.ms/sppnp Column Formatting Design Mode Pre-selected Color Classes Adjusts for Dark Themes Switch to JSON
  • 21. theChri sKent.c omaka.ms/sppnp SP-Dev-List-Formatting Samples • 50+ Sample Formats • Instructions & Screenshots • Copy & Paste directly from GitHub bit.ly/LF-samples
  • 23. theChri sKent.c omaka.ms/sppnp View Formatting • Superset of Column Formatting • Apply directly to views • Format current view menu • Stored with the View • Overrides Column Formats (Row Formats) Paste Here Online Only
  • 24. theChri sKent.c omaka.ms/sppnp View Formatting Flavors Row Class Row Format • Uses additionalRowClass • Applies class(es) to each row • Can be conditionally applied • Ignored when rowFormatter is used • Uses rowFormatter • Responsible for full rendering of the row Online Only
  • 26. theChri sKent.c omaka.ms/sppnp Supported Column Types • Calculated • Choice • ContentType • Counter (ID) • Currency* • Date/Time • Hyperlink • Lookup • Multi-Choice • Multi-Line Text* • Multi-Person • Number • Person • Picture • Single line of text • Title (in Lists) • Yes/No • Managed Metadata • Retention Label • Filename (in Document Libraries) Can’t Reference: Same support applies to both Column and View Formatting *Apply Format through Field Settings
  • 27. theChri sKent.c omaka.ms/sppnp JSON Syntax Crash Course • An object is a set of name/value pairs • Objects begin with a { and end with a } • Each name is followed by a : • Name/value pairs are separated by a , { “elmType”: “div”, “debugMode”: false } Adapted from json.org
  • 28. theChri sKent.c omaka.ms/sppnp • An object is a set of name/value pairs • Objects begin with a { and end with a } • Each name is followed by a : • Name/value pairs are separated by a , • An array is an ordered collection of values • Arrays begin with a [ and end with a ] • Array values are separated by a , { “elmType”: “div”, “debugMode”: false, “children”: [ { “elmType”: “span”, “txtContent”: “Yo” }, { “elmType”: “span”, “txtContent”: “ Dawg!” } ] } Adapted from json.org JSON Syntax Crash Course
  • 29. theChri sKent.c omaka.ms/sppnp { “elmType”: “div”, “debugMode”: false, “children”: [ { “elmType”: “span”, “txtContent”: “Yo” }, { “elmType”: “span”, “txtContent”: “ Dawg!” } ], “style”: { “color”: “red”, “padding-left”: “4px” } } • An object is a set of name/value pairs • Objects begin with a { and end with a } • Each name is followed by a : • Name/value pairs are separated by a , • An array is an ordered collection of values • Arrays begin with a [ and end with a ] • Array values are separated by a , • A value can be a string in double quotes, a number, true, false, null, object, or array Adapted from json.org JSON Syntax Crash Course
  • 38. theChri sKent.c omaka.ms/sppnp div span span <div class="sp-field-customFormatter sp-field-severity--severeWarning"> <span style="padding-left:4px;" iconname="Warning" class=" css-148"></span> <span style="padding-left:4px;">Wise Polar Bear</span> </div> Format JSON Rendered Column Element Visualization Generated HTML
  • 39. theChri sKent.c omaka.ms/sppnp View Formatting Syntax • hideColumnHeader • When true, the view won’t have any column headers • hideSelection • When true, users can’t select rows • additionalRowClass • Class(es) to apply to the whole row • You can use expressions • Only applied when rowFormatter is not specified • rowFormatter • Column Formatting syntax to create elements Top level props
  • 40. theChri sKent.c omaka.ms/sppnp “elmType”: “” • div (box) • span (inline box) • a (link) • img (picture) • button (clicky thing) • svg (fancy picture) • path (part of the fancy picture) Only Required Property
  • 41. theChri sKent.c omaka.ms/sppnp Element Content • txtContent • Text value OR • children • Sub elements • Ignored when txtContent is specified What’s in the Box
  • 42. theChri sKent.c omaka.ms/sppnp “attributes”: { } Everybody • class – CSS class(es) • title - tooltip • iconName – UIFabric icon • role - accessibility • aria-* -accessibility a (links) • href – where to go • target – open in new window or not • rel – relationship img • src – image location path • d – path to be drawn Directly in the element
  • 43. theChri sKent.c omaka.ms/sppnp “style”: { } • background-color • fill • background-image • border • border-bottom • border-bottom-color • border-bottom-style • border-bottom-width • border-color • border-left • border-left-color • border-left-style • border-left-width • border-right • border-right-color • border-right-style • border-right-width • border-style • border-top • border-top-color • border-top-style • border-top-width • border-width • outline • outline-color • outline-style • outline-width • border-bottom-left-radius • border-bottom-right- radius • border-radius • border-top-left-radius • border-top-right-radius • box-decoration-break • box-shadow • box-sizing • overflow-x • overflow-y • overflow-style • rotation • rotation-point • opacity • cursor • height • max-height • max-width • min-height • min-width • width • flex-grow • flex-shrink • flex-flow • flex-direction • flex-wrap • flex • justify-content • align-items • box-align • box-direction • box-flex • box-flex-group • box-lines • box-ordinal-group • box-orient • box-pack • font • font-family • font-size • font-style • font-variant • font-weight • font-size-adjust • font-stretch • grid-columns • grid-rows • margin • margin-bottom • margin-left • margin-right • margin-top • column-count • column-fill • column-gap • column-rule • column-rule-color • column-rule-style • column-rule-width • column-span • column-width • columns • padding • padding-bottom • padding-left • padding-right • padding-top • bottom • clear • clip • display • float • left • overflow • position • right • top • visibility • z-index • border-collapse • border-spacing • caption-side • empty-cells • table-layout • color • direction • letter-spacing • line-height • text-align • text-decoration • text-indent • text-transform • unicode-bidi • vertical-align • white-space • word-spacing • hanging-punctuation • punctuation-trim • text-align-last • text-justify • text-outline • text-shadow • text-wrap • word-break • word-wrap Nest in the style attribute 132
  • 44. theChri sKent.c omaka.ms/sppnp “customRowAction”: { “action”: “”} • defaultClick – opens the info pane • editProps – opens the info pane in edit mode • share – opens the sharing dialog • delete – opens the delete confirmation dialog • executeFlow – launches the flow panel Only work within button elements (Use the style and children properties to get fancy!) You cannot use expressions in the action property
  • 45. theChri sKent.c omaka.ms/sppnp “customRowAction”: { “actionParams”: “”} • Only used for “action”: “executeFlow” • Escaped JSON • ”ID”: required • ID of Flow to launch • ”headerText”: optional • Sets the text at the top of the flow panel • ”runFlowButtonText” optional • text of the primary button Online Only
  • 46. theChri sKent.c omaka.ms/sppnp Live List Updates • Formats are automatically redrawn as items update • Magic • Does NOT (yet?) work in the list/library web parts • sadness Online Only
  • 48. theChri sKent.c omaka.ms/sppnp … “txtContent”: “@currentField” … • Works great for simple values (text, choice, yes/no, and numbers) • Type is respected • Dates should use one of the format operations: “toLocaleString()” – date and time “toLocaleDateString()” – just the date “toLocaleTimeString()” – just the time • Always resolves to Title in view formatting Placeholder Tokens • “@currentField” • Get the current item’s value
  • 49. theChri sKent.c omaka.ms/sppnp … “txtContent”: “@currentField.title” … • Can’t use “@currentField” directly, use dot-notation to get properties: “@currentField.title” “@currentField.id” “@currentField.email” “@currentField.sip” “@currentField.picture” “@currentField.department” “@currentField.jobTitle” • Person field props Placeholder Tokens • “@currentField” • Get the current item’s value
  • 50. theChri sKent.c omaka.ms/sppnp … “txtContent”: “@currentField.lookupValue” … • Can’t use @currentField directly, use dot-notation to get properties: “@currentField.lookupValue” “@currentField.lookupId” • Person field props • Lookup field props Placeholder Tokens • “@currentField” • Get the current item’s value
  • 51. theChri sKent.c omaka.ms/sppnp • Person field props • Lookup field props • Hyperlink field props … “txtContent”: “@currentField.desc” … • Can use @currentField directly AND dot-notation to get properties: “@currentField” – URL value “@currentField.desc” - Description Placeholder Tokens • “@currentField” • Get the current item’s value
  • 52. theChri sKent.c omaka.ms/sppnp … “txtContent”: “[$Title]” … • Wrap internal name in [$FIELD] • Access Person/Lookup/URL properties in same way as with @currentField “[$Author.email]” “[$OtherListItem.lookupValue]” • Person field props • Lookup field props • Other Fields (same row) • Hyperlink field props Placeholder Tokens • “@currentField” • Get the current item’s value
  • 53. theChri sKent.c omaka.ms/sppnp … “txtContent”: “@me” … • “@me” resolves to the current user’s email address • “@now” resolves to the date/time at render (doesn’t keep getting evaluated) • Uses the browser’s timezone! • Person field props • Lookup field props • Other Fields (same row) • Hyperlink field props • “@me” • “@now” Placeholder Tokens • “@currentField” • Get the current item’s value
  • 54. theChri sKent.c omaka.ms/sppnp Placeholder Tokens … “txtContent”: “@window.innerHeight” … • “@window.innerHeight” resolves to a number equal to the height of the browser window (in pixels) at render • “@window.innerWidth” resolves to a number equal to the width of the browser window (in pixels) at render • Person field props • Lookup field props • Other Fields (same row) • Hyperlink field props • “@me” • “@now” • “@window” These do NOT update as the window resizes • “@currentField” • Get the current item’s value Online Only
  • 55. theChri sKent.c omaka.ms/sppnp Placeholder Tokens … “txtContent”: “@currentWeb” … • Same as page context webAbsoluteUrl • Does not end with a slash • Other Fields (same row) • “@me” • “@now” • “@window” • “@currentField” • “@currentWeb” • “[$FieldName]” Hardcoded URL • Always works • Not reusable across sites Relative URL • Reusable across sites • URLs dependent on relative location Online Only
  • 56. theChri sKent.c omaka.ms/sppnp Placeholder Tokens … “txtContent”: “@rowIndex” … • Evaluates to the rendered index of a row within a view • Independent of sorts or filters • Starts at 0 • Alternating Rows! • “@me” • “@now” • “@window” • “@currentField” • “@currentWeb” • “[$FieldName]” Online Only • “@rowIndex”
  • 57. theChri sKent.c omaka.ms/sppnp Placeholder Tokens … “src”: “@thumbnail.medium” … • Provides the URL to the thumbnail of a file (document libraries only) • No value for list items or folders “@thumbnail.small” “@thumbnail.medium” “@thumbnail.large” @thumbnail.<width>x<height> “@thumbnail.100x200” @thumbnail.<width> “@thumbnail.150” • Aspect ratio is maintained • Only value of src, auto hidden when unavailable • “@me” • “@now” • “@window” • “@currentField” • “@currentWeb” • “[$FieldName]” Online Only • “@rowIndex” • “@thumbnail”
  • 58. theChri sKent.c omaka.ms/sppnp Expressions • Abstract Syntax Tree (AST) • operator/operands • Nest additional expressions • Excel-style expressions • Single line • Combine expressions • Online Only
  • 59. theChri sKent.c omaka.ms/sppnp Expressions • Abstract Syntax Tree (AST) • operator/operands • Nest additional expressions • Excel-style expressions • Single line • Combine expressions • Electrolytes
  • 60. theChri sKent.c omaka.ms/sppnp Expressions • Abstract Syntax Tree (AST) • operator/operands • Nest additional expressions • Excel-style expressions • Single line • Combine expressions • Electrolytes
  • 61. theChri sKent.c omaka.ms/sppnp Expressions • Abstract Syntax Tree (AST) • operator/operands • Nest additional expressions • Excel-style expressions • Single line • Combine expressions • Electrolytes
  • 62. theChri sKent.c omaka.ms/sppnp Arithmetic Operators Operator Does Examples Results + Adds stuff (numbers & text) “=4 + 5” “=@currentWeb+‘/lists‘” 9 https://t.sharepoint.com/sites/s/lists - Subtracts stuff “=97 - 10” 87 / Divides stuff “=25 / 5” 5 * Multiplies stuff “=5 * 5” 25 % Modulus* (remainder) “=@rowIndex % 2” 1 or 0 cos Cosine “=cos(5) 0.28366218546322625 sin Sine “=sin(90)” 0.8939966636005579 abs Absolute Value* “=abs(-45)” 45 *Online Only
  • 63. theChri sKent.c omaka.ms/sppnp Conditional & Logical Operators Operator Does Examples Results ? or if if(condition, when true, when false) < Less than “=if(1 < 2, ’cat’, ’dog’)” cat > Greater than “=if(1 > 2, ’cat’, ’dog’)” dog <= Less than or Equal “=if(2 <= 2, ’horse’, ’duck’)” horse >= Greater than or Equal “=if(2 >= 3, ’horse’, ’duck’)” duck == Equals “=if(5 == 5, ’badger’, ’hen’)” Badger != Not equals “=if(7 != 7, ’badger’, ’hen)” hen || Or “=if(1<2 || 1<0, ‘man’, ‘elf’)” man && And “=if(1<2 && 1<0, ‘man’, ‘elf’)” elf This Photo by Unknown Author is licensed under CC BY-SA-NC
  • 64. theChri sKent.c omaka.ms/sppnp Conversion Operators Operator Does Examples Results toString To text “=toString(45)” “45” Number To a number “=Number(‘365’)” “=Number(‘Wowee’)” “=Number(Date(‘12/26/1981’))” 365 NaN 378190800000 Date To datetime “=Date(‘12/26/1981’)” “=Date(378190800000)” 12/26/1981 12:00:00 AM 12/26/1981 12:00:00 AM toLowerCase* Text to lowercase “=toLowerCase(‘DogFood’)” dogfood toLocaleString Datetime to locale text “=toLocaleString(@now)” “5/21/2019, 2:25:12 PM” toLocaleDateString Datetime to locale date only text “=toLocaleDateString(@now)” “5/21/2019” toLocaleDateTimeString Datetime to locale time only text “=toLocaleDateTimeString(@now)” “2:25:12 PM” *Online Only
  • 65. theChri sKent.c omaka.ms/sppnp Mulit-Value & Loop Operators Operator Does Examples Results indexOf Character index (starting at 0) of some text within text “=indexOf(‘DogFood’, ‘Dog’)” “=indexOf(‘DogFood’, ‘F’)” “=indexOf(‘DogFood’, ‘Cat’)” “=indexOf(‘DogFood’, ‘f’)” 0 3 -1 -1 length Number of multi-value values “=length([$MultiChoice])” “=length(‘Some Text’)” “=length(‘’)” 3 1 0 join Turns multi-values into text with a separator =“join([$MultiChoice], ‘, ‘)” =“join([$MultiChoice], ‘|‘)” “A, B, C” “A|B|C” loopIndex Current index of an iterator (forEach) “=loopIndex(‘personIterator’)” 2 Online Only
  • 67. theChri sKent.c omaka.ms/sppnp Column Formatting vs Field Customizer
  • 68. theChri sKent.c omaka.ms/sppnp Column Formatting vs Field Customizer Customization Column Formatting Field Customizer Conditional Formatting Supported Supported
  • 69. theChri sKent.c omaka.ms/sppnp Column Formatting vs Field Customizer Customization Column Formatting Field Customizer Conditional Formatting Supported Supported Actions Simple actions and links (no script) Any type
  • 70. theChri sKent.c omaka.ms/sppnp Column Formatting vs Field Customizer Customization Column Formatting Field Customizer Conditional Formatting Supported Supported Actions Simple actions and links (no script) Any type Visualizations Static visualizations (HTML & Styles) Whatever!
  • 71. theChri sKent.c omaka.ms/sppnp Column Formatting vs Field Customizer Customization Column Formatting Field Customizer Conditional Formatting Supported Supported Actions Simple actions and links (no script) Any type Visualizations Static visualizations (HTML & Styles) Whatever! Page Context @now, @me, @window, @currentWeb Full context!
  • 72. theChri sKent.c omaka.ms/sppnp Column Formatting vs Field Customizer Customization Column Formatting Field Customizer Conditional Formatting Supported Supported Actions Simple actions and links (no script) Any type Visualizations Static visualizations (HTML & Styles) Whatever! Page Context @now, @me, @window, @currentWeb Full context! JavaScript Nope Yep Custom CSS Classes Nope, limited subset & inline styles Yep Interactivity Nope Yep
  • 73. theChri sKent.c omaka.ms/sppnp Column Formatting vs Field Customizer Customization Column Formatting Field Customizer Conditional Formatting Supported Supported Actions Simple actions and links (no script) Any type Visualizations Static visualizations (HTML & Styles) Whatever! Page Context @now, @me, @window, @currentWeb Full context! JavaScript Nope Yep Custom CSS Classes Nope, limited subset & inline styles Yep Interactivity Nope Yep Developer Required “No” (but also yes) Yes Solution Deployment Anyone with Designer Permissions App/Site Catalog • 90% of list customization use cases can be covered by Column Formatting* • Another 5% by View Formatting* • For everything else, use SPFx *made up by me
  • 74. theChri sKent.c omaka.ms/sppnp List Formatting Limitations • No Real String Operations • No Custom Date Formats or Date Parts • No viewbox attribute for SVG elements • Unable to use parenthesis in style props (except for rgba) • No Gradients • No image backgrounds • Numbers are floats and you can’t round them • Missing ms-Grid support • Schema discrepancies • No localization • List Web Part Inconsistencies & Limits • Standard User Interface is lacking
  • 75. theChri sKent.c omaka.ms/sppnp List Formatting Awesomeness • Quick & “easy” visualizations that can have a significant impact • Site Column integration • Text based (easy source control) • Can be applied by Site Designers • Supported in Site Designs & Remote Provisioning • Great performance • Getting better all the time • NO Solution Package deployment required • List Formatter fills the UI gap
  • 77. List Formatter ListFormatter.com Easy editor for modern listview Formatting
  • 78. theChri sKent.c omaka.ms/sppnp Final Tips & Tricks • UI Fabric Classes • Theme Colors • Hover Styles • Font Sizes & Weights • Purge AST from your brain • Turn debugMode off • Write HTML 1st • Dynamic Images • 1000+ icons – use them! • Test in multiple themes • Use List Formatter The Modern Listview
  • 79. theChri sKent.c omaka.ms/sppnp PnP SIG SharePoint General Development Call • Every other Thursday, 16:00 CEST • Recorded to YouTube • Next call on 5/30 • Recurring List Formatting tips & tricks • currentWeb • forEach, loopIndex • Contains, StartsWith, indexOf • Design Mode • Alternating Row Styles • Conditionally launching flows • Multi-line field formats • ContentTypes • Custom Row Actions • UI Fabric Classes (themed formats) • Customizing the Flow Panel • SVG Icons Previous List Formatting Tips covered
  • 82. theChri sKent.c omaka.ms/sppnp Extra stuff just for you! • The next few slides were cut for time • They still (mostly) have valuable content • Reach out with any questions (@theChrisKent) • Enjoy!
  • 83. theChri sKent.c omaka.ms/sppnp Predefined Classes sp-field-severity--good background-color sp-field-severity--low background-color sp-field-severity--warning background-color sp-field-severity--severeWarning background-color sp-field-severity--blocked background-color sp-field-dataBars background-color, padding, color, border-top sp-field-trending--up text color sp-field-trending--down text color sp-field-quickActions font, padding (used with icons) Use UIFabric.io color & typography classes to match theme
  • 84. theChri sKent.c omaka.ms/sppnp “attributes”: { “iconName”: “Cat” } uifabricicons.azurewebsites.net
  • 85. theChri sKent.c omaka.ms/sppnp Design Mode Classes sp-css-backgroundColor- • neutralBackground (50,40,30) • blueBackground07 (17,27,37) • successBackground (50,40,30) • warningBackground (50,40,30) • blockingBackground (50,40,30) • errorBackground (50,40,30)
  • 86. theChri sKent.c omaka.ms/sppnp Don’t Use Rich Text • List Formatting encodes values • Rich text values contain HTML • HTML will be encoded and displayed
  • 87. theChri sKent.c omaka.ms/sppnp forEach • Cannot add to Root Element • Turns element into a template • Repeated for each item in the array • Creates Virtual Field • Access using Field Syntax [$personIterator] • Name appropriately (don’t clobber your fields) • Can be nested “VirtualFieldName in ArrayField” @currentField or [$SomeOtherField]
  • 88. theChri sKent.c omaka.ms/sppnp loopIndex • Zero-Based • Position in forEach loop • Meaningless outside of loop • Specify the iterator name • “=loopIndex(‘personIterator’)” • Rhymes with PoopWindex
  • 89. theChri sKent.c omaka.ms/sppnp Scalable Vector Graphics (SVGs) • “elmType”: “svg” • “elmType”: “path” • No viewbox attribute • Makes them just VGs • Provides lots of options, but can get confusing • Use with care • Dynamic SVGs using expressions in d attribute!
  • 92. theChri sKent.c omaka.ms/sppnp Bi-Weekly SP General Development • aka.ms/sppnp-core-sig-call • List Formatting, PowerApps, CSOM, PowerShell, Provisioning, Flow • Next Call: Thursday, 2/21 Bi-Weekly SharePoint Framework • aka.ms/sppnp-js-sig-call • SPFx, PnP JS Core • Next Call: Thursday, 2/14 Monthly Community Calls • aka.ms/sppnp-call • Monthly Summary • Next Call: Tuesday, 3/12 Bi-Weekly SP General Development • aka.ms/sppnp-core-sig-call • List Formatting, PowerApps, CSOM, PowerShell, Provisioning, Flow • Next Call: Thursday, 5/30 Bi-Weekly SharePoint Framework • aka.ms/sppnp-js-sig-call • SPFx, PnP JS Core • Next Call: Thursday, 5/23 Monthly Community Calls • aka.ms/sppnp-call • Monthly Summary • Next Call: Tuesday, 6/11
  • 93. theChri sKent.c omaka.ms/sppnp Official Blog dev.office.com/blogs Twitter @OfficeDevPnP Tech Community aka.ms/sppnp- community

Editor's Notes

  • #5: Can I possibly get my name on a single slide even more? Wow.
  • #9: Slides are intended for reuse. Lots of information on them, we’ll be moving quickly. Goal is to make you aware of what you can do and provide guides for when you do it later.
  • #23: Design Mode Samples Very Basic Syntax
  • #26: Demonstrate Contact Card Row Format View Formatting Sample: https://github.com/SharePoint/sp-dev-list-formatting/tree/master/view-samples/contact-card-format
  • #48: Demonstrate Generic Start Flow Column Formatting Sample: https://github.com/SharePoint/sp-dev-list-formatting/tree/master/column-samples/generic-start-flow Demonstrate Secret Lab with Live List Updates Additional Details here: https://thechriskent.com/2018/08/29/list-formatting-quick-tip-format-only-columns/
  • #80: https://aka.ms/spdev-sig-call