Conditional Formatting
11 TopicsSharePoint List Calendar View Conditional Formatting
Hi all, I've been spinning my wheels on this one. I have created a calendar view from a SP list and want to color code calendar items based on the event type (field = "Event_Type"). They selection list is formatted as radio buttons. I've written the following JSON and input into the Advanced View under Conditional Formatting. I've tried everything I can think of to de-bug but it seems the code is correct? Yet it isn't working: { "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json", "additionalEventClass": { "operator": ":", "operands": [ { "operator": "==", "operands": [ "[$Event_Type]", "Vacation/Out of Office" ] }, "=if(@isSelected == true, 'sp-css-color-WhiteFont sp-css-backgroundColor-BgRed' , 'sp-css-backgroundColor-BgDustRose sp-css-color-DustRoseFont')+' sp-field-fontSizeSmall'", { "operator": ":", "operands": [ { "operator": "==", "operands": [ "[$Event_Type]", "Training" ] }, "=if(@isSelected == true, 'sp-css-color-WhiteFont sp-css-backgroundColor-BgGreen' , 'sp-css-backgroundColor-BgMintGreen sp-css-color-MintGreenFont')+' sp-field-fontSizeSmall'", { "operator": ":", "operands": [ { "operator": "==", "operands": [ "[$Event_Type]", "Onboarding" ] }, "=if(@isSelected == true, 'sp-css-color-WhiteFont sp-css-backgroundColor-BgBrown' , 'sp-css-backgroundColor-BgGold sp-css-color-GoldFont')+' sp-field-fontSizeSmall'", { "operator": ":", "operands": [ { "operator": "==", "operands": [ "[$Event_Type]", "Holiday" ] }, "=if(@isSelected == true, 'sp-css-color-WhiteFont sp-css-backgroundColor-BgTeal' , 'sp-css-backgroundColor-BgCyan sp-css-color-CyanFont')+' sp-field-fontSizeSmall'", { "operator": ":", "operands": [ { "operator": "==", "operands": [ "[$Event_Type]", "Meeting" ] }, "=if(@isSelected == true, 'sp-css-color-WhiteFont sp-css-backgroundColor-BgDarkPurple' , 'sp-css-backgroundColor-BgViolet sp-css-color-VioletFont')+' sp-field-fontSizeSmall'", { "operator": ":", "operands": [ { "operator": "==", "operands": [ "[$Event_Type]", "Event" ] }, "=if(@isSelected == true, 'sp-css-color-WhiteFont sp-css-backgroundColor-BgBlue' , 'sp-css-backgroundColor-BgCornflowerBlue sp-css-color-CornflowerBlueFont')+' sp-field-fontSizeSmall'", { "operator": ":", "operands": [ { "operator": "==", "operands": [ "[$Event_Type]", "Board" ] }, "=if(@isSelected == true, 'sp-css-color-WhiteFont sp-css-backgroundColor-BgGray' , 'sp-css-backgroundColor-BgLightGray sp-css-color-LightGrayFont')+' sp-field-fontSizeSmall'", { "operator": ":", "operands": [ { "operator": "==", "operands": [ "[$Event_Type]", "Wellness" ] }, "=if(@isSelected == true, 'sp-css-color-WhiteFont sp-css-backgroundColor-BgDarkGreen' , 'sp-css-backgroundColor-BgSage sp-css-color-SageFont')+' sp-field-fontSizeSmall'", "" ] } ] } ] } ] } ] } ] } ] } ] } }Solved11KViews0likes10CommentsConditional Formatting based on one field
I have a modern Sharepoint list with a Status field. If the status is selected 'To Be Removed' I'd like to strike through the entire row. I can't find an example like this online, would someone be able to advise what the JSON for this would be? Apologies - I'm a complete JSON beginner! ThanksSolved4.7KViews0likes3CommentsSharePoint List Calendar View Conditional Formatting Not Displaying for Everyone
Good afternoon, I have an odd issue I'm struggling with. I've implemented some JSON code that changes the color of a Sharepoint calendar view event based on the event type. Most people see the color coding, however some people see all event types as one color (red). At first I thought it had to do with the level of MS access each user had (the first to flag it was an outside consultant), but a few others also experience this issue and their access levels range from Associate through Director. Has anyone else experienced this issue and know how to fix it? Thank you.971Views0likes0CommentsConditional formatting - only show button if attachments are present
Hi, I am trying to only show a button in a column, if there is an attachment present in the same row on the attachment column. Here is what I have so far: { "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "button", "txtContent": "Send Offer", "customRowAction": { "action": "executeFlow", "actionParams": "{\"id\": \"f191e7c8-1a36-4553-9d64-607764fc6f83\"}" }, "style": { "background-color": "blue", "color": "white", "visibility": "=if(([$Attachments] == false),'visible','hidden')" } } I have tried changing " [$Attachments] == false) " to equals true, 1 and 0, and there's still no use. If I look into the address bar I can see " FilterField1=Attachments&FilterValue1=1 ", but even when I enter "1" as the value the button still does not display when attachments are present. Any help is highly appreciated. Thank you!1.9KViews0likes1CommentSet column value based on another columns date
In Document Library i have a column with a date. This date is filled out by a Power Automate approval flow. We alse have a second column which has 3 choices. >2 months old, <2 months old, >4 months old. As i understand sharepoint calculated column can't use TODAY() or NOW(), so i must use conditional formatting? I need help with JSON formatting to: - if date in column "Approval Date" is more than 4 months old, set value ">4 months old" - color RED - if date in column "Approval Date" is more than 2 months old, set value ">2 months old" - color orange - if date in column "Approval Date" is less than 2 months old, set value "<2 months old" - color green I could run a flow daily to update this, but i think that is waste of computing resources, when maybe conditional formatting can do the trick? Optional: If possible they should be the new type of formatting of choice with rounded colores around text?Solved4.8KViews0likes3CommentsMulti level group
Hi All, Within a document library view of sharepoint online, there seems to be a limit of 2 on the amount group by's that can be done. One of my clients needs to group on 3 or even more levels. My quetsions: - Is this functionality coming in future releases? - Is there any alternative to achieve this functionality? I am thinking of Conditional Formatting? Thanks in advance1.6KViews0likes1CommentConditional Formatting in Sharepoint List based on hidden column items
Hi all, I'm facing the following issue and don't still couldn't find any solution: I made a conditional formatting of the lists-lines based on items on the column "A" now I want to hide the column "A". After it, the conditional formatting doesn't work. It works only if the column isn't hidden. Do you know the way I can hide the column and the formatting works? Thank you in advance! Best regards Dimitrij4KViews0likes2CommentsUsing Power Automate to create a new item in SharePoint if the total Qty is not matched.
How can I create a flow in Power Automate or use conditional formatting in SharePoint to create a new item/separate line if the result in one column, "approved or shipped Qty" does not match the original input of "requested Qty". So the balance of what was not approved/shipped is then input into a new line/ new row as its own requested qty. Thank you.1.4KViews0likes1CommentConditional Formatting SharePoint List
Hello team, I need your support with conditional JSON formatting of SharePoint list. I would like to format column INVEST_DUE_DATE based on current date (date cell) and based on value in column Phase (string). Right now, I implemented just formatting based on date, using following code: { "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "div", "txtContent": "@currentField", "style": { "background-color": "=if(@currentField < @now , '#f7adad', if(@currentField <= @now + 864000000, '#f2d596', if(@currentField >= @now + 864000000 , '#a0dec0', '')))" } } I want to apply additional condition for it - use color formatting only if value of cell Phase = Investigation. So , it should be something like this (@currentField < @now) and @[$Phase]='Investigation' , '#f7adad', and etc.... But it does not works.... Could you please advise me how to modify initial JSON code? Thank you in advance!12KViews0likes5CommentsConditional formatting - Button flow inserted in SharePoint list - how to insert a logic condition
Hi, I have added a column with flow button, in my list, using JSON. I am really a beginner in JSON. I need to add a condition like: If Status=Pending or Status=Approved with comments, then show "Send to Approval" button. The code is in the attachment. Any help is highly appreciated. Thank you!Solved7.7KViews0likes3Comments