6

Yep, your alternative to an inline expression is this for concatenating values: { "elmType": "div", "txtContent": { "operator": "+", "operands": [ "[$Duration]", " ", "[$DurationUnits]" ] } } Output (example): 8 hour(s)


5

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.


4

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 other words you can create new formatted view, that can look completely different then the out-of-the-box one. Official description: https://support.office.com/...


3

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 the List/Library view, you can achieve something similar to that using View Formatting(Format View) option. You can use view formatting to customize how ...


3

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([$OtherColumn] == 'Amber', 'amber', if([$OtherColumn] == 'Gray', 'gray', 'blue'))))"


3

You almost got it. Set src attribute directly. src is just URL to an image, so why to use description at all. If you look at the rendered HTML code using Developer dashboard (F12) you will find that the src of img tag contains url and description. Simply use: { "elmType": "img", "style": { "width": "100px" }, "attributes": { "src": "@...


2

In Classic UI, we can add the following code into a script editor web part in list view to achieve it. <script type="text/javascript"> (function () { // Create object that have the context information about the field that we want to change it's output render var fieldContext = {}; fieldContext.Templates = {}; fieldContext....


2

When you add a image to Picture Library SharePoint creates a thumbnail for that image and show it in your default view of the list. In response for your question: Yes, the thumbnail URL differ from the URL of the full size image. And how does the thumbnail URL differ from the URL of the full size image. Example: Original URL http://yoursite.com/Images/...


2

The way I understood, you want to display text like 'expired', 'expiring','current' instead of date. Extending jerry's answer, you can use below { "elmType": "div", "style": { "background-color": "=if(@currentField >= @now - 25920000000 ,'green', (if(@currentField >= @now - 31104000000, '#ffa59b','red'))" }, "children" :[ { "elmType":...


2

For Modern UI: Yes, you can use json formatting to conditionally color fields in sharepoint online. The following example colors the current date field red when the value inside an item's ExpirationDate is before the current date/time. { "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json", "elmType": "div",...


2

You could use $ID. Sample demo: { "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json", "elmType": "a", "txtContent": "@currentField", "attributes": { "target": "_blank", "href": "= @currentWeb + '/ChildB/DispForm.aspx?ID=' + [$ID]" } }


2

We can use the JSON formatting below to achieve it. { "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json", "elmType": "div", "style": { "background-color": "=if(indexOf(@currentField, '.0')!=-1, 'green', 'red')", "color":"white" }, "children": [ { "elmType": "span", "style": { ...


2

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. Reference: Column Formatting. Alternative solution: You can use Client Side Rendering (CSR) to highlight rows based on choice columns: Reference: How to ...


2

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 can use Filter by option to filter the rows based on column value. View Formatting: SharePoint Online Modern Experience View formatting does not supports ...


2

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 AnotherColumnFromSameRow is internal name another column from same list item/row.


2

Would this one help you? { "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json", "elmType": "div", "children": [ { "elmType": "span", "txtContent": "@currentField", "style": { "padding-left": "8px", "white-space": "nowrap" } } ], "attributes": { "class": "sp-...


1

As a workaround, we can create a text field "ApprovalStatus", then create a workflow to set the value from the "Approval Status" field to this new field. Then using the JSON below: { "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json", "elmType": "div", "debugMode": true, "txtContent": "[$ApprovalStatus]" }


1

slightly updated version making use of the supported CSS styles: { "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json", "elmType": "div", "attributes": { "class": "=if(indexOf(@currentField, '.0')!=-1,'sp-field-severity--good', 'sp-field-severity--warning')" }, "children": [ { "elmType": "span", ...


1

Modify the JSON formatting as below. { "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json", "elmType": "div", "txtContent": "=if([$Review_x0020_Status] == '', @currentField, '• '+@currentField)", "style": { "color": "=if([$Review_x0020_Status] == 'Not Due', 'green', if([$Review_x0020_Status] ...


1

Use below formula: ="<DIV style='font-weight:bold; font-size:24px; color:"&IF([Review Status]="Approaching","Green",IF([Review Status]="OverDue","Red","Yellow"))&";'>•</DIV>" Note: Return this field as Number field. Microsoft blocked handling HTML markup in SharePoint calculated fields for recent versions, see here. If you are using ...


1

We found that the issues was caused by the browser. Used Edge and it worked fine.


1

What is the type of your field on which you are adding this JSON? Currently Column/JSON Formatting will support only following column types: Supported column types: The following column types support column formatting: Single line of text Number Choice Person or Group Yes/No Hyperlink Picture Date/Time Lookup Title (in Lists) The following are not ...


1

Those are style attributes and will need to be nested in a style property. So adjusting your format like this should apply those values: { "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json", "elmType": "div", "children": [ { "elmType": "div", "style": { "width": "100%", ...


1

You can use JSON to do the work. use the JSON code below { "elmType": "div", "txtContent": "@currentField", "style": { "background-color": "=if(@currentField >= @now - 25920000000 ,'green', (if(@currentField >= @now - 31104000000, '#ffa59b','red'))" } } Reference: http://thebaretta.blogspot.com/2018/08/sharepoint-online-conditional.html


1

You have wrong json, Issue 1 - your first style attribute is not closing at the end, so all other childrens element is coming under it Issue 2 - "color", "font-size" should be above children tag Issue 3 - in children's array - "attributes": should be outside of style Below is corrected one... I think below should work. { "elmType": "div", "...


1

You would need to create an SPFx FieldCustomizer Essentially you then would write @override public onRenderCell(event: IFieldCustomizerCellEventParameters): void { event.domElement.innerHTML = `<div>${event.fieldValue.replace(/[,\.]/g, "")}</div>`; } or whatever modifications you'd want to make.


1

Yes, we can use JSON to format the column in the list. But we cannot use JSON to format the list title. We can add the custom code in the modern list and format the list title. More references: Use an SPFx Application Customizer to add JavaScript (e.g. header) to every page in a site SPFx Applications Customiser CSS Injection


1

If you want to format the whole list view, I suggest you use View Formatting to achieve it. The following article with the example code for your reference. sp-dev-list-formatting-view-samples If you only want to increasing the font size, we can use the following JSON formatting to achieve it. { "schema": "https://developer.microsoft.com/json-schemas/sp/...


1

Managed Metadata type of field is not supported in column formatting. Supported column types The following column types support column formatting: Single line of text Number Choice Person or Group Yes/No Hyperlink Picture Date/Time Lookup Title (in Lists) The following are not currently supported: Managed Metadata Filename (in Document ...


1

You've basically got the "Or" idea down. You only need to switch it to "And," except without using &&'s or ||'s. Here's what I mean: I'm going to split this out onto multiple lines so it's easier to see. Obviously, you will have to put it back onto one line to use it: //Basic if syntax: if( condition, resultIfTrue, resultIfFalse ) //OR ...


Only top voted, non community-wiki answers of a minimum length are eligible