14
votes
Accepted
JSON Column formatting - Joining values
Yep, your alternative to an inline expression is this for concatenating values:
{
"elmType": "div",
"txtContent": {
"operator": "+",
"operands": [
"[$Duration]",
" ",
"[$...
5
votes
what can you do with Format View
Adding to what Lukas has mentioned .
Long story short, just look at the snip below (Taken from the Microsoft official description) for complete view of what Formatting can do.
5
votes
How to add a link to list item in a JSON view format?
You could use $ID.
Sample demo:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
"elmType": "a",
"txtContent": "@currentField",
"attributes": {
...
4
votes
Accepted
How to utilize if/else condition for JSON column formatting in SharePoint?
You can do it similar to that in Excel :)
You can checkout the below sample to get an idea:
"background-color": "= if([$OtherColumn] == 'Red', 'red',
if([$OtherColumn] == 'Green', 'green',
if([$...
4
votes
How to add a link to list item in a JSON view format?
There is another option that is to just use the defaultClick action:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
"elmType&...
4
votes
Accepted
what can you do with Format View
Improve the display of views in SharePoint lists with formatting. The view-formatting text describes the elements that are displayed and their display style. The data in the list doesn't change.
In ...
4
votes
Accepted
Can we render element based on the current field value in Column Formatting?
Try using below JSON:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"style":...
4
votes
Accepted
Lists: Circle progress bar as column view
Yes, it is possible using JSON column formatting capabilities.
Check this sample available in GitHub list formatting samples repository:
Doughnut Chart
Additional formatting samples:
Number Battery
...
4
votes
Accepted
How can I add a link to list attachments using Json formatting
Unfortunately, the attachments field is not directly accessible in JSON formatting.
You can only check if attachments are available or not for the list item using:
"txtContent": "=if([$...
3
votes
what can you do with Format View
Using format view, you can format rendering of your library view. As in Previous version of SharePoint/Classic experience SharePoint developers are using Client side rendering(CSR) option to customize ...
3
votes
Accepted
Display HTML formatted text from Rich Text multi-line column in SharePoint list column formatted with JSON
Currently, rich multiline text fields are not supported within json column formatting. You could read this article: https://github.com/SharePoint/sp-dev-list-formatting/issues/88
The only workaround ...
3
votes
Accepted
If statement JSON column formatting - SharePoint Online List
I looks to me like you want the text to be #168DC8 and the background to be white unless the lookupValue is not one of the defined conditions, then you'd like them swapped. Try this format:
{
"$...
3
votes
Accepted
JSON column formatting hover styling
I've been asking for hover styles for a long time. Unfortunately, as Michael Han_MSFT wrote in his answer the best you can get is the --hover classes.
Fortunately, you can get creative with them to ...
3
votes
Using json to modify lots of different columns in a SharePoint list
There is no way to apply JSON formatting to multiple columns at a time using SharePoint out of the box capabilities.
So, you need to use PowerShell and automate this process to apply JSON formatting ...
3
votes
Accepted
How to hide column if no choices are selected
Conditional formulas in SharePoint online modern experience does not support Multiple choice column.
Reference: Supported column types in conditional show or hide
3
votes
How to display past list items related to a column value?
In order to display a custom hover card, you need to use customCardProps element. See more details here. It has the following properties:
openOnEvent
hover - card appears on mouse hover;
click - card ...
3
votes
Accepted
Conditional formatting of a field on a sharepoint list by month of a date
Use either of below JSON codes on your date column as per your requirements:
Based on Month only:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting....
3
votes
Accepted
Trigger flow with icon instead of button?
You will require button element to use action and actionParams.
However, you can add children elements to button element to add icon & text (if required).
Example:
{
"$schema": "...
3
votes
Accepted
How can I show JSON formatting only for one content type and keep the default for all others?
Use JSON code similar to this:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"...
3
votes
Accepted
Data Bar Color Change
You can use JSON like below to conditionally change the color of data bars:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
"...
3
votes
How to create a progress bar that updates on status change
You can use SharePoint JSON column formatting for this.
Example:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType&...
2
votes
Accepted
Column Formatting Option not available
You cannot use column formatting using JSON in SharePoint 2013.
Column formatting using JSON is available for SharePoint Online, SharePoint Server 2019, and SharePoint Online Small Business only.
...
2
votes
Accepted
sharepoint column formatting json examples with paging
Column Formatting:
If you have formatted your column using JSON formatting, it will support Sorting and Filtering.
See below image, "Container Content" column is sorted in descending order and you ...
2
votes
Accepted
Organize multi-choice user inputs by separate line (not comma)
Try using below JSON code on your choice field:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "...
2
votes
Accepted
Get value of Name column from SPO list for JSON formatting
According to the official documentation,
You can use this context([$FieldName]) to reference the values of other fields within the same row by specifying the internal name of the field surrounded by ...
2
votes
Accepted
How can JSON column formatting be used to highlight duplicate entries in a column a list?
No.
In column formatting, you cannot access/use the column values from another list item/row.
You can only access the column values from the same list item/row like [$AnotherColumnFromSameRow].
Where ...
2
votes
JSON Column formatting : retrieve view ID or param in URL
Solution:
Create SPFx Field Customizer so you could get the view id by this.context.pageContext.legacyPageContext
2
votes
Accepted
Insert bold in column formatting
Try this:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"debugMode": true,
"txtContent": "@currentField",
"style": {
...
2
votes
Accepted
Status calculated column colour code
You can use Column/JSON formatting to achieve this. Use below JSON code to change the color of the text:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema....
2
votes
Accepted
SPO: Create Hyperlink from Calculated Column
Try with this json:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "a",
"txtContent": "[$InternalNameOfYourNameColumn]",
"...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
column-formatting × 336sharepoint-online × 299
json-formatting × 295
modern-experience × 209
list × 166
json × 25
document-library × 14
power-automate × 12
sharepoint-server × 11
list-view × 11
lookup-column × 10
calculated-column × 10
2019 × 10
date-time × 9
flow × 7
person-or-group × 7
view-formatting × 7
conditional × 6
column × 5
hyperlink × 5
formatting × 5
sharepoint-enterprise × 4
calculated-column-formula × 4
custom-list × 3
choice-field × 3