Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json",
- "hideSelection": true,
- "hideColumnHeader": true,
- "rowFormatter": {
- "elmType": "div",
- "style": {
- "background-color": "=if([$EntryType] == '1Heading', '#efefef', if([$Status] == 'Out', '#f99090', if([$Status] == 'In', '#aaffaf', if([$Status] == 'Leave', '#ffa754', if([$Status] == 'Home Visit', '#8587f2', if([$Status] == '', '#a2dff9', '')))))",
- "height": "=if([$EntryType] == '1Heading', '40px', '80px')",
- "float": "Left",
- "margin": "0.5%",
- "min-width": "220px",
- "margin-top": "=if([$EntryType] == '1Heading', '1.5%', '0.3%')",
- "width": "=if([$EntryType] == '1Heading', '94%', '18.5%')",
- "padding": "3px"
- },
- "attributes": {
- "class": "sp-row-card"
- },
- "children": [
- {
- "elmType": "div",
- "style": {
- "display": "=if([$Status], 'none', '')",
- "text-align": "center",
- "width": "100%"
- },
- "children": [
- {
- "elmType": "div",
- "attributes": {
- "class": "sp-row-title"
- },
- "style": {
- "font-size": "1.5em"
- },
- "txtContent": "[$Title]"
- },
- {
- "elmType": "button",
- "customRowAction": {
- "action": "defaultClick"
- },
- "txtContent": "Open",
- "attributes": {
- "class": "sp-row-button"
- },
- "style": {
- "margin-top": "5%"
- }
- }
- ]
- },
- {
- "elmType": "div",
- "style": {
- "display": "=if([$EntryType] == '1Heading', '', 'none')",
- "text-align": "center",
- "width": "100%"
- },
- "children": [
- {
- "elmType": "div",
- "attributes": {
- "class": "sp-row-title"
- },
- "style": {
- "font-size": "2em",
- "font-weight": "normal"
- },
- "txtContent": "[$Title]"
- }
- ]
- },
- {
- "elmType": "div",
- "style": {
- "text-align": "left",
- "width": "100%",
- "display": "=if([$EntryType] != '1Heading' && [$Status], '', 'none')",
- "padding": "8px",
- "border": "=if([$Status] != 'Home Visit', 'rgba(0,0,0,0)', if([$Returning] <= @now, '7px solid yellow', 'rgba(0,0,0,0)'))",
- "border-radius": "3px",
- "border-style": "dashed",
- "height": "82%",
- "position": "relative"
- },
- "children": [
- {
- "elmType": "div",
- "attributes": {
- "class": "sp-row-title"
- },
- "style": {
- "float": "right"
- },
- "txtContent": "=if([$EntryType] == '2Manager', [$Team] + ' Manager', if([$EntryType] == '3Coordinator', [$Team] + ' Coordinator', '[$Team]')"
- },
- {
- "elmType": "div",
- "attributes": {
- "class": "sp-row-title"
- },
- "style": {
- "font-weight": "bold"
- },
- "txtContent": "[$Person.title]"
- },
- {
- "elmType": "div",
- "style":
- {
- "float": "right",
- "display": "=if([$Status] == 'Home Visit', '', 'none')"
- },
- "txtContent": "=toString('Returning by ' + toLocaleTimeString([$Returning]))"
- },
- {
- "elmType": "div",
- "attributes": {
- "class": "sp-row-listPadding"
- },
- "style": {
- "font-size": "1.2em",
- "font-weight": "bold",
- "color": "=if([$Status] == 'Home Visit' && [$Returning] <= @now, 'yellow', '')"
- },
- "txtContent": "=if([$Status] == 'Home Visit' && [$Returning] <= @now, 'Home Visit - LATE', [$Status])"
- },
- {
- "elmType": "button",
- "customRowAction": {
- "action": "editProps"
- },
- "txtContent": "Edit",
- "attributes": {
- "class": "sp-row-button"
- },
- "style": {
- "position": "absolute",
- "bottom": "2px",
- "right": "5px",
- "margin-left": "7px"
- }
- },
- {
- "elmType": "div",
- "attributes": {
- "class": "sp-row-listPadding"
- },
- "txtContent": "[$Notes]"
- },
- {
- "elmType": "div",
- "attributes": {
- "class" : "sp-row-listPadding"
- },
- "style": {
- "position": "absolute",
- "bottom": "2px"
- },
- "txtContent": "=toString('Updated ' + if(toLocaleDateString(@now) != toLocaleDateString[$Modified], 'more than a day ago', toLocaleTimeString([$Modified])))"
- }
- ]
- }
- ]
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement