10

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

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

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


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

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

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

Conditional formulas in SharePoint online modern experience does not support Multiple choice column. Reference: Supported column types in conditional show or hide


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

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

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

Solution: Create SPFx Field Customizer so you could get the view id by this.context.pageContext.legacyPageContext


2

Try this: { "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "div", "debugMode": true, "txtContent": "@currentField", "style": { "color": "=if([$Ev_x002e__x0020_sluttid] <=[$_x00c4_rende_x0020_p_x00e5_b_x00], '#ff0000', '#32CD32')", "font-weight": "bold" } } References: CSS ...


2

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.json", "elmType": "div", "debugMode": true, "txtContent": "@currentField", "style": { "color": "=if(@currentField == 'Open', '#ff0000', '#00ff00')" }...


2

Try with this json: { "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "a", "txtContent": "[$InternalNameOfYourNameColumn]", "attributes": { "target": "_blank", "href": "[$URL]" } } Btw, Name should be reserved name, so the internal name of your Name column is probably different ...


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": { "display": "table", "width": "100%" }, "children": [ { "elmType": "a", "txtContent": "[$Name]", "attributes": { "target": "...


2

Rich text fields can be referenced like any other field. If this formatting is on this field then the use of @currentField should work just fine as shown below: { "elmType": "a", "txtContent": "Send Mail", "attributes": { "iconName": "Mail", "class": "sp-field-quickActions", "href": { "operator": "+", "operands": [ "...


2

UPDATE I've just heard back from the engineering team working on this issue. They identified the issue as a regression and they have now rolled out the fix across production. You posting this issue here helped solve it for everyone! Thank you! Original Answer This looks to be an issue not specific to the Content Type Hub. Up until recently you could apply ...


2

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 accomplish what you want. Give this format a try: { "$schema": "http://columnformatting.sharepointpnp.com/columnFormattingSchema.json", &...


2

All Excel-style expressions begin with an equal (=) sign. This style of expression is only available in SharePoint Online (not SharePoint 2019). https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/column-formatting#excel-style-expressions You need to use basic styled syntax, please refer to https://social.technet.microsoft.com/Forums/...


2

Maybe your milliseconds for 20 days are not correct, it should be 1728000000 (86400000 *20). After correcting it, I'm getting the below output. Is that the expected outcome? Updating the response to show different color for days > 60 Please note that there is no predefined classes, so had to use background-color style Updated JSON (if statement has been ...


2

This is the formula to calculate days in Milliseconds days in Milliseconds = Number of days * (24*60*60*1000) So for 60 days, it should be 5184000000 But I think the issue is not related to Milliseconds, it's related to the condition itself where you should use && to define the period of time as the following: Example For 60 days, you have to check ...


2

Updated to show Traffic Light as circle in the output: { "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "div", "txtContent": "•", "style": { "color": "=if([$EndDate]>(@now +259200000), 'Green', if([$...


2

As per my understanding you want set the color of "Filing" column cell to red if (Correct me if I am wrong): LFR sign column is not empty AND Filing column is empty Then try adding below JSON to "Filing" column: { "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json", &...


2

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 appears on click on the field. directionalHint topCenter bottomCenter leftCenter rightCenter isBeakVisible - boolean. if true the card has a beak. Sample ...


2

Try this: { "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "div", "txtContent": "@currentField", "style": { "background-color": "=if(getMonth([$DateField])==getMonth(@now), 'Orange', '')", "...


2

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


2

If your "Name" column is of type "Single line of text", use below for display attribute: "display": "=if([$Name] != '', 'block', 'none')" If your "Name" column is of type "Person or Group", use below for display attribute: "display": "=if([$Name.title] != '', 'block', 'none')" ...


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