SOLVED

ifnot empty conditional formatting (JSON) for sharpoint lists

%3CLINGO-SUB%20id%3D%22lingo-sub-2941723%22%20slang%3D%22en-US%22%3Eifnot%20empty%20conditional%20formatting%20(JSON)%20for%20sharpoint%20lists%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2941723%22%20slang%3D%22en-US%22%3E%3CP%3EI%20would%20like%20to%20do%20some%20conditional%20formatting%20so%20that%20a%20column%20in%20a%20list%20is%20hidden%20until%20the%20previous%20column%20has%20some%20data%20in%20it.%26nbsp%3B%3C%2FP%3E%3CP%3Elike%20i%20imagine%20something%20like%26nbsp%3B%3Difnot(%5B%24Date1%5D%20%3D%3D%20'null'%2C%20'true'%2C%20'false')%3C%2FP%3E%3CP%3Eis%20there%20something%20like%20an%20ifnot%20function%20and%20is%20null%20a%20an%20option%20for%20if%20there%20is%20nothing%3F%7C%3C%2FP%3E%3CP%3ECheers%26nbsp%3B%3C%2FP%3E%3CP%3ESam%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2941723%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ELists%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMicrosoft%20Lists%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2942271%22%20slang%3D%22en-US%22%3ERe%3A%20ifnot%20empty%20conditional%20formatting%20(JSON)%20for%20sharpoint%20lists%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2942271%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1212094%22%20target%3D%22_blank%22%3E%40EKIT415%3C%2FA%3E%26nbsp%3BYou%20can%20use%20a%20formula%20like%20below%20to%20check%20if%20date%20column%20is%20blank%20or%20not%3A%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-javascript%22%3E%3CCODE%3E%3Dif(%5B%24DateField%5D%2C%20'true'%2C%20'false')%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOr%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-javascript%22%3E%3CCODE%3E%3Dif(Number(%5B%24DateField%5D)%20!%3D%200%2C%20'true'%2C%20'false')%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhere%26nbsp%3B%3CSTRONG%3EDateField%3C%2FSTRONG%3E%20is%20internal%20name%20of%20your%20date%20%26amp%3B%20time%20column.%26nbsp%3B%3C%2FP%3E%3CP%3ESee%20other%20ways%20to%20check%20if%20date%20column%20is%20blank%20or%20not%20using%20SharePoint%20JSON%20formatting%3A%26nbsp%3B%3CA%20title%3D%22SharePoint%20JSON%20formatting%3A%20Check%20if%20date%20%26amp%3B%20time%20column%20is%20blank%2Fempty%22%20href%3D%22https%3A%2F%2Fganeshsanapblogs.wordpress.com%2F2021%2F06%2F20%2Fsharepoint-json-formatting-check-if-date-and-time-column-is-blank-empty%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3ESharePoint%20JSON%20formatting%3A%20Check%20if%20date%20%26amp%3B%20time%20column%20is%20blank%2Fempty%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CHR%20%2F%3E%3CP%3EPlease%20click%20%3CSTRONG%3EMark%20as%20Best%20Response%3C%2FSTRONG%3E%20%26amp%3B%20%3CSTRONG%3ELike%3C%2FSTRONG%3E%20if%20my%20post%20helped%20you%20to%20solve%20your%20issue.%20This%20will%20help%20others%20to%20find%20the%20correct%20solution%20easily.%20It%20also%20closes%20the%20item.%20If%20the%20post%20was%20useful%20in%20other%20ways%2C%20please%20consider%20giving%20it%20%3CSTRONG%3ELike%3C%2FSTRONG%3E.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

I would like to do some conditional formatting so that a column in a list is hidden until the previous column has some data in it. 

like i imagine something like =ifnot([$Date1] == 'null', 'true', 'false')

is there something like an ifnot function and is null a an option for if there is nothing?|

Cheers 

Sam 

1 Reply
best response confirmed by EKIT415 (Occasional Contributor)
Solution

@EKIT415 You can use a formula like below to check if date column is blank or not: 

 

=if([$DateField], 'true', 'false')

 

Or 

 

=if(Number([$DateField]) != 0, 'true', 'false')

 

Where DateField is internal name of your date & time column. 

See other ways to check if date column is blank or not using SharePoint JSON formatting: SharePoint JSON formatting: Check if date & time column is blank/empty 


Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.