8

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


2

Try using below JSON code: { "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json", "elmType": "div", "txtContent": "@currentField", "style": { "background-color": "=if(@currentField == 'XYZ', 'blue', if(@currentField == 'ABC', 'red', 'white'))", } } Reference: Use column formatting to ...


2

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


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

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

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


1

I can reproduce the same issue on my SharePoint Online library. I think column formatting is not supported for this column yet (Even when it is of type Person or Group). I tried applying the JSON code from both library view and column settings but it not accepting the JSON while saving) You can check the supported columns from below documentation: Use ...


1

For now as Ganesh described You need to use the JSON formatting based on conditions and updating the styles of the component. As online is tagged I am guessing we should talk only about this version. Please be aware You can modify this styles of a column -> Use column formatting to customize SharePoint - styles so for Your needs this kind of example: ...


1

By looking at the errors, I think this issue is because your JSLink file is not loaded properly. There is some specific syntax to give the path of .js file in JSLink, check below: Path: Save this JSLink.js file in same site and add path to miscellaneous --> as ~site/SiteAssets/JSLink.js. OR Save this JSLink.js file in same site collection and add path to ...


1

You need modify the code as below. (function () { var statusFieldContext = {}; statusFieldContext.Templates = {}; statusFieldContext.Templates.Fields = { // Apply the new rendering for Priority field on List View "Status": { "View": statusFieldTemplate } }; SPClientTemplates.TemplateManager.RegisterTemplateOverrides(...


1

I'm going to answer my own question. After me playing around with settings of the column I figured it out In case your column settings for display the choice is set to Drop-Down Menu, then everything will work fine, and you will get the format column template. In case your column settings for display the choice is set to Checkboxes (allow multiple ...


1

Short Answer to your question is No. Currently there is no variable/function available to get the current View ID/Name while using JSON formatting on column. For more information on column formatting, check below documentation: Use column formatting to customize SharePoint.


1

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 square brackets and preceded by a dollar sign: [$InternalName]. So, you need to use the internal name of your Name column in your JSON code. Check below URL ...


1

I guess using the Column formatting using JSON is one of the best way to run your flow right from Library view. You can use column formatting to create buttons that, when selected, run Flows on the corresponding list item. The Flow Launch Panel will be displayed after choosing the button and the Flow will just run. Source: Create a button to launch a ...


1

Try the below JSON snippet to avoid the date column is blank, { "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "div", "attributes": { "class": "= if(Number([$Visa_Expiration]) == 0, '' , if([$Visa_Expiration] <= @now+86400000*60 && [$Visa_Expiration] > @now ...


1

You can use toLocaleDateString() function/operator in Column formatting to convert your date in friendly format. According to official documentation, toLocaleDateString(): returns a language sensitive representation of just the date portion of a date "txtContent":"=toLocaleDateString(@now)" ---> results vary based on user's locale, ...


1

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


1

As you are saying: "AAA" is a link not text I believe it should either be like http://AAA or https://AAA. So in that case you can use below JSON code to hide the links with http://AAA or https://AAA: { "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "a", "txtContent": "@currentField....


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