12

Yep, your alternative to an inline expression is this for concatenating values: { "elmType": "div", "txtContent": { "operator": "+", "operands": [ "[$Duration]", " ", "[$DurationUnits]" ] } } or also { "elmType": "div", "txtContent": "=[$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

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'))))"


4

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]" } }


4

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": "@...


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/...


4

Try using below JSON: { "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "div", "style": { "background-color": "=if(@currentField == 'Design','#CACFD2', if(@currentField == 'Active-Minimal','#CAF0CC',if(@currentField == 'Active-...


3

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",...


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

Use the defaultHoverField property in JSON as described here: Use column formatting to customize SharePoint


3

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: { "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json", "elmType": "div", "txtContent": "@currentField.lookupValue", "style"...


3

Try using this: "additionalRowClass": "=if([$Deleted] == 'Deleted', 'sp-field-strikeThrough sp-css-color-red', if([$Modified] < @now && [$Modified] >= @now - 86400000, 'ms-bgColor-gray50', if([$Modified] < @now && [$Modified] >= @now - 259200000, 'ms-bgColor-gray20' , '')))" This will first check if [$Deleted] ...


3

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 to multiple columns. You can find the PowerShell script to get you started with in below references: SharePoint Online: Apply Column Format using PowerShell Add ...


3

After debugging, I found that the validation function receives the lookup field values in this format: <Lookup ID>;#<Lookup Title>: In your case, if the Hourly item has an id of 1, then the JSON formulata should be written this way: =if([$LookupField]=='1;#Hourly', 'true', 'false') Proof that it works Update If you want to avoid "...


3

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.schema.json", "elmType": "div", "txtContent": "@currentField", "style": { "background-color&...


3

Yes, you can do that using JSON view formatting. Follow below steps: Go to your SharePoint list Click on switch view options dropdown at the top & select Format current view. Make sure Format view & Gallery is selected like below: Click on Edit card & then select Advanced mode In the JSON text box below, change the width property as per your ...


3

As you are showing the image dynamically using JSON in column formatting, it is working fine in list view. But, JSON formatting only displays the value/image in list view >> It does not store the actual value in list columns. So, to show the image in Gallery view, you have to replicate the same logic (used in column formatting) in auto-generated JSON ...


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

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 could try using URL encoding (percent encoding), replacing the & with %26. You can find all encoded characters on W3C.


2

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": "button", "customRowAction": { "action": "defaultClick" }, "attributes": { "class&...


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

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

This view formatting only works in the Tiles view. The format expects the Title field The format expects a text column with an internal name of Feedback The format expects a person column with an internal name of Assigned_x0020_To If you want to works in the List view, we can use the formatting below. { "schema": "https://developer.microsoft.com/json-...


2

Try using below JSON code on your choice field: { "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "div", "txtContent": "=join(@currentField, '\n')" } Official documentation: Use column formatting to customize SharePoint. Reference ...


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-...


2

I followed the same steps to create two Yes/No columns, one from modern view (named FromView) and another from list settings page(named FromSettings). Tried below combinations and it is working fine for me: Yes/No column created from Modern View: { "schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json", "...


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