JSON. Header
3 TopicsConditional Formatting for List Header
First post here so forgive me if I am not detailed enough. I am creating an approval process and I am using this header formatting. As an example, for HR approval, I would like to tweak it for the HR approval portion to be hidden in the header until a certain text field is longer "null". I can hide it the list form itself but I am having trouble hiding the actual header. For my example, the below would only say "Manager Approval" until a text field (lets say "Name") is no longer "null". Along the lines of: =if([$Name]==true, 'true', 'false') Would this be possible?Solved2.2KViews0likes3CommentsJSON Header Formatting Issue
Hello, I am having trouble with the code below. This code is adjusted from this header formatting. Here are the issues I am having: Manager Approval-->Not Approved: I would like for this to be red. The entire circle disappears when I try to adjust the "Not Approved" code Ethics Approval: This code works just fine. I would like to know how to delete the HR approval codes without jeopardizing the ethics approver code. For example, when I remove everything that has to do with HR Approval, the entire circle disappears (Fig 1) SNL Approval: This circle stays green even if their is nothing in the column. If someone's name is entered in the column "SNL Approver Name", then it should be green, like Ethics Approval. I tried using the same code as the Ethics Approval but it does not work. (The approver name column for this one is "Person Group' while Ethics is "Single Line Text") I would also like to get rid of the unnecessary HR approval codes (circle disappears when adjusting it) Fig. 1 { "elmType": "div", "attributes": { "iconName": "=if([$Ethics_Approver_Name] != '' ,'CompletedSolid' ,'CircleShapeSolid'))", "class": "=if([$Ethics_Approver_Name] != '' ,'ms-fontSize-42 ms-fontColor-green',if([$Ethics_Approver_Name] == '' ,'ms-fontSize-42 ms-fontColor-yellow','ms-fontSize-42 ms-fontColor-neutralTertiary'))" } { "elmType": "div", "style": { "margin": "5px", "width": "100%", "height": "160px", "border": "2px dashed", "padding": "10px", "display": "flex", "flex-direction": "column", "align-items": "center" }, "children": [ { "elmType": "div", "txtContent": "Project Initiation (PI)", "attributes": { "class": "ms-fontSize-28 ms-fontWeight-bold" } }, { "elmType": "div", "style": { "display": "flex", "justify-content": "center", "width": "100%" }, "children": [ { "elmType": "div", "style": { "display": "flex", "flex-direction": "row" }, "children": [ { "elmType": "div", "style": { "width": "140px", "display": "flex", "flex-direction": "column", "align-items": "center", "margin": "20px" }, "children": [ { "elmType": "div", "txtContent": "Manager Approval", "style": { "margin-bottom": "5px" }, "attributes": { "class": "ms-fontSize-15" } }, { "elmType": "div", "attributes": { "iconName": "=if([$Manager_Approval] == 'Approved' ,'CompletedSolid', if([$AD_Approval] == 'Not Approved' ,'CompletedSolid' , 'CircleShapeSolid'))", "class": "=if([$Manager_Approval] == 'Approved' ,'ms-fontSize-42 ms-fontColor-green', if([$AD_Approval] == 'Approved' ,'ms-fontSize-42 ms-fontColor-green',if([$AD_Approval] == 'Pending AD Approval' ,'ms-fontSize-42 ms-fontColor-yellow',if([$AD_Approval] == 'Not Approved' ,'ms-fontSize-42 ms-fontColor-yellow',if([$Manager_Approval] == 'Pending Manager Approval' , 'ms-fontSize-42 ms-fontColor-yellow' ,if([$Manager_Approval] == 'Not Approved' , 'ms-fontSize-42 ms-fontColor-red' , 'ms-fontSize-42 ms-fontColor-neutralTertiary'))))))" } } ] }, { "elmType": "div", "style": { "width": "80px", "display": "flex", "flex-direction": "column", "align-items": "center", "margin-top": "50px" }, "txtContent": "---------->", "attributes": { "class": "ms-fontSize-16" } }, { "elmType": "div", "style": { "width": "120px", "display": "flex", "flex-direction": "column", "align-items": "center", "margin": "20px" }, "children": [ { "elmType": "div", "txtContent": "🧐AD Approval", "style": { "margin-bottom": "5px" }, "attributes": { "class": "ms-fontSize-15" } }, { "elmType": "div", "attributes": { "iconName": "=if([$AD_Approval] == 'Approved' ,'CompletedSolid' , 'CircleShapeSolid')", "class": "=if([$AD_Approval] == 'Approved' ,'ms-fontSize-42 ms-fontColor-green',if([$AD_Approval] == 'Pending AD Approval' , 'ms-fontSize-42 ms-fontColor-yellow' ,if([$AD_Approval] == 'Not Approved' , 'ms-fontSize-42 ms-fontColor-red' , 'ms-fontSize-42 ms-fontColor-neutralTertiary'))" } } ] }, { "elmType": "div", "style": { "width": "80px", "display": "flex", "flex-direction": "column", "align-items": "center", "margin-top": "50px" }, "txtContent": "---------->", "attributes": { "class": "ms-fontSize-16" } }, { "elmType": "div", "style": { "width": "140px", "display": "flex", "flex-direction": "column", "align-items": "center", "margin": "20px" }, "children": [ { "elmType": "div", "txtContent": "Ethics Approval", "style": { "margin-bottom": "5px" }, "attributes": { "class": "ms-fontSize-15" } }, { "elmType": "div", "attributes": { "iconName": "=if([$Ethics_Approver_Name] != '' ,'CompletedSolid' ,if([$ApprovalStatus] == 'Rejected by HR' ,'CompletedSolid' , if([$ApprovalStatus] == 'Pending HR Approval' ,'CompletedSolid' ,'CircleShapeSolid')))", "class": "=if([$Ethics_Approver_Name] != '' ,'ms-fontSize-42 ms-fontColor-green', if([$Ethics_Approver_Name] == '' ,'ms-fontSize-42 ms-fontColor-yellow', if([$ApprovalStatus] == 'Pending HR Approval' ,'ms-fontSize-42 ms-fontColor-green',if([$ApprovalStatus] == 'Rejected by HR' ,'ms-fontSize-42 ms-fontColor-green',if([$ApprovalStatus] == 'Pending Manager Approval' , 'ms-fontSize-42 ms-fontColor-yellow' ,if([$ApprovalStatus] == 'Rejected by Manager' , 'ms-fontSize-42 ms-fontColor-red' , 'ms-fontSize-42 ms-fontColor-neutralTertiary')))))" } } ] }, { "elmType": "div", "style": { "width": "80px", "display": "=if([$Are_x0020_you_x0020_using_x0020_] =='CSI','block', 'none')", "flex-direction": "column", "align-items": "center", "margin-top": "50px" }, "txtContent": "---------->", "attributes": { "class": "ms-fontSize-16" } }, { "elmType": "div", "style": { "width": "120px", "display": "=if([$Are_x0020_you_x0020_using_x0020_] =='CSI','block', 'none')", "flex-direction": "column", "align-items": "center", "margin": "20px" }, "children": [ { "elmType": "div", "txtContent": "SNL Approval", "style": { "display": "=if([$Are_x0020_you_x0020_using_x0020_] =='CSI','block', 'none')", "margin-bottom": "5px" }, "attributes": { "class": "ms-fontSize-15" } }, { "elmType": "div", "attributes": { "iconName": "=if([$SNL_Approver_Name] != '' ,'CompletedSolid' , 'CircleShapeSolid')", "class": "=if([$SNL_Approver_Name] != '' ,'ms-fontSize-42 ms-fontColor-green',if([$ApprovalStatus] == 'Pending HR Approval' , 'ms-fontSize-42 ms-fontColor-yellow' ,if([$ApprovalStatus] == 'Rejected by HR' , 'ms-fontSize-42 ms-fontColor-red' , 'ms-fontSize-42 ms-fontColor-neutralTertiary'))" } } ] } ] } ] } ] }2KViews0likes2CommentsSharePoint List Form Header Fields
Hi All, First post and if anyone can help it would be appreciated. I have a SharePoint list where there are some columns that I do not want users to edit. As column level restrictions do not appear to be available I was looking at a work around: Using the JSON formatting provided by Microsoft I included the relevant fields in the Header. This all works fine until I remove the columns from the form which also removes the fields from the header. If anyone has any ideas it would appreciated. Regards Mark2.5KViews0likes1Comment